]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
HID: hid-pl: handle probe errors
authorOliver Neukum <oneukum@suse.com>
Wed, 19 Nov 2025 09:09:57 +0000 (10:09 +0100)
committerJiri Kosina <jkosina@suse.com>
Sat, 10 Jan 2026 09:08:41 +0000 (10:08 +0100)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-pl.c

index 3c8827081deae21cdc66d9b9dfa77cf85c819df6..dc11d5322fc0f952a12086ffe5473dd9c9779769 100644 (file)
@@ -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;
 }