Skip to contentSkip to conversation

HID: ACRUX - add missing hid_hw_stop() in ax_probe() error path

PATCH In review Axel Lin 2 participants 2 messages Jul 14, 2011 HID

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 HID: ACRUX - add missing hid_hw_stop() in ax_probe() error path

hid_hw_stop() must be called in ax_probe() error path if hid_hw_start() was successful.

---
 drivers/hid/hid-axff.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hid/hid-axff.c +1 -0
index b455428..1215141 100644
@@ -154,6 +154,7 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	error = hid_hw_open(hdev);
 	if (error) {
 		dev_err(&hdev->dev, "hw open failed\n");
+		hid_hw_stop(hdev);
 		return error;
 	}
 
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 13 lines · Axel Lin

hid_hw_stop() must be called in ax_probe() error path if hid_hw_start() was successful.

---
 drivers/hid/hid-axff.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hid/hid-axff.c +0 -0
index b455428..1215141 100644

drivers/hid/hid-axff.c static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) · line 159

Quoted 6 lines
drivers/hid/hid-axff.c +1 -0
@@ -154,6 +154,7 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	error = hid_hw_open(hdev);
 	if (error) {
 		dev_err(&hdev->dev, "hw open failed\n");
+		hid_hw_stop(hdev);
 		return error;
 	}

Good catch, applied. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs