summaryrefslogtreecommitdiff
path: root/drivers/staging/dgrp/dgrp_driver.c
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2013-04-05 21:14:23 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 21:24:11 (GMT)
commit7e1389a9e622a421e85e8611c76bd9142bf4bff1 (patch)
tree784857c59a2b0f28d14f3364f31bb27a5ab9aca4 /drivers/staging/dgrp/dgrp_driver.c
parent70e90fb57f517dca891c737f8120389af71baee0 (diff)
downloadlinux-7e1389a9e622a421e85e8611c76bd9142bf4bff1.tar.xz
staging: dgrp: implement error handling in dgrp_create_class_sysfs_files()
There is no any error handling in dgrp_create_class_sysfs_files(). The patch adds code to check return values and propagate them to dgrp_init_module(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgrp/dgrp_driver.c')
-rw-r--r--drivers/staging/dgrp/dgrp_driver.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/dgrp/dgrp_driver.c b/drivers/staging/dgrp/dgrp_driver.c
index aa26258..e456dc6c 100644
--- a/drivers/staging/dgrp/dgrp_driver.c
+++ b/drivers/staging/dgrp/dgrp_driver.c
@@ -66,6 +66,8 @@ module_exit(dgrp_cleanup_module);
*/
static int dgrp_init_module(void)
{
+ int ret;
+
INIT_LIST_HEAD(&nd_struct_list);
spin_lock_init(&dgrp_poll_data.poll_lock);
@@ -74,7 +76,9 @@ static int dgrp_init_module(void)
dgrp_poll_data.timer.function = dgrp_poll_handler;
dgrp_poll_data.timer.data = (unsigned long) &dgrp_poll_data;
- dgrp_create_class_sysfs_files();
+ ret = dgrp_create_class_sysfs_files();
+ if (ret)
+ return ret;
dgrp_register_proc();