Skip to contentSkip to conversation

HID: hid-pl: handle probe errors

PATCH In review Oliver Neukum 2 participants 3 messages Mar 3 – Mar 4

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: hid-pl: handle probe errors

Commit 3756a272d2cf356d2203da8474d173257f5f8521 upstream.

Errors in init must be reported back or we'll
follow a NULL pointer the first time FF is used.

Fixes 20eb127906709 ("hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter")
---
 drivers/hid/hid-pl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/hid/hid-pl.c +6 -1
index 3c8827081dea..dc11d5322fc0 100644
@@ -194,9 +194,14 @@ static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id)
 		goto err;
 	}
 
-	plff_init(hdev);
+	ret = plff_init(hdev);
+	if (ret)
+		goto stop;
 
 	return 0;
+
+stop:
+	hid_hw_stop(hdev);
 err:
 	return ret;
 }
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 11 lines · Oliver Neukum

Commit 3756a272d2cf356d2203da8474d173257f5f8521 upstream.

Errors in init must be reported back or we'll
follow a NULL pointer the first time FF is used.

Fixes 20eb127906709 ("hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter")
---
 drivers/hid/hid-pl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

What kernel tree(s) is this for?

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 5 lines · Oliver Neukum

Commit 3756a272d2cf356d2203da8474d173257f5f8521 upstream.

Errors in init must be reported back or we'll
follow a NULL pointer the first time FF is used.

Quoted 8 lines
Quoted 6 lines
Fixes 20eb127906709 ("hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter")
---
  drivers/hid/hid-pl.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

What kernel tree(s) is this for?

6.12

Sorry
Oliver