Skip to contentSkip to conversation

hdaps: Handle errors from

PATCH New Jean Delvare 1 participant 1 message Aug 28, 2006 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 2/14 hdaps: Handle errors from

From: Dmitry Torokhov <dtor at insightbb.com>
Content-Disposition: inline; filename=hwmon-hdaps-handle-errors-from-input-register-device.patch

HDAPS: handle errors from input_register_device()

Signed-off-by Dmitry Torokhov <dtor at mail.ru>
Signed-off-by Jean Delvare <khali at linux-fr.org>

---

 drivers/hwmon/hdaps.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/hwmon/hdaps.c +5 -1
@@ -587,7 +587,9 @@
 	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 @@
 	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:
Signature · 1 line
Jean Delvare