Skip to contentSkip to conversation

HDAPS: handle errors from

PATCH New Dmitry Torokhov 2 participants 2 messages Aug 2, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HDAPS: handle errors from

Compile-tested only (do not have the hardware)

Signature · 34 lines
Dmitry


HDAPS: handle errors from input_register_device()

Signed-off-by: Dmitry Torokhov <dtor at mail.ru>
---

 drivers/hwmon/hdaps.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

Index: work/drivers/hwmon/hdaps.c
=================================--- work.orig/drivers/hwmon/hdaps.c
+++ work/drivers/hwmon/hdaps.c
@@ -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);
@@ -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:
#1 lore raw

PATCH 1/1 HDAPS: handle errors from

Hi Dmitry,

Quoted 3 lines

Compile-tested only (do not have the hardware)
(...)
HDAPS: handle errors from input_register_device()

Looks good, applied. Thanks!

Signature · 1 line
Jean Delvare