Skip to content

Commit

Permalink
hdaps: Handle errors from input_register_device
Browse files Browse the repository at this point in the history
HDAPS: handle errors from input_register_device()

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dmitry Torokhov authored and Greg Kroah-Hartman committed Sep 28, 2006
1 parent c41bdb5 commit b25a106
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/hwmon/hdaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,9 @@ static int __init hdaps_init(void)
input_set_abs_params(hdaps_idev, ABS_Y,
-256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT);

input_register_device(hdaps_idev);
ret = input_register_device(hdaps_idev);
if (ret)
goto out_idev;

/* start up our timer for the input device */
init_timer(&hdaps_timer);
Expand All @@ -598,6 +600,8 @@ static int __init hdaps_init(void)
printk(KERN_INFO "hdaps: driver successfully loaded.\n");
return 0;

out_idev:
input_free_device(hdaps_idev);
out_group:
sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group);
out_device:
Expand Down

0 comments on commit b25a106

Please sign in to comment.