This is a note to let you know that I've just added the patch titled HID: sony: fix error path in probe to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: hid-sony-fix-error-path-in-probe.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7998193bccc1c6e1537c5f3880fd0d5b949ec9d1 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx> Date: Thu, 2 Dec 2021 10:53:31 +0100 Subject: HID: sony: fix error path in probe From: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx> commit 7998193bccc1c6e1537c5f3880fd0d5b949ec9d1 upstream. When the setup of the GHL fails, we are not calling hid_hw_stop(). This leads to the hidraw node not being released, meaning a crash whenever somebody attempts to open the file. Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx> Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20211202095334.14399-2-benjamin.tissoires@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/hid/hid-sony.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -3037,19 +3037,23 @@ static int sony_probe(struct hid_device */ if (!(hdev->claimed & HID_CLAIMED_INPUT)) { hid_err(hdev, "failed to claim input\n"); - hid_hw_stop(hdev); - return -ENODEV; + ret = -ENODEV; + goto err; } if (sc->quirks & (GHL_GUITAR_PS3WIIU | GHL_GUITAR_PS4)) { - if (!hid_is_usb(hdev)) - return -EINVAL; + if (!hid_is_usb(hdev)) { + ret = -EINVAL; + goto err; + } usbdev = to_usb_device(sc->hdev->dev.parent->parent); sc->ghl_urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!sc->ghl_urb) - return -ENOMEM; + if (!sc->ghl_urb) { + ret = -ENOMEM; + goto err; + } if (sc->quirks & GHL_GUITAR_PS3WIIU) ret = ghl_init_urb(sc, usbdev, ghl_ps3wiiu_magic_data, @@ -3059,7 +3063,7 @@ static int sony_probe(struct hid_device ARRAY_SIZE(ghl_ps4_magic_data)); if (ret) { hid_err(hdev, "error preparing URB\n"); - return ret; + goto err; } timer_setup(&sc->ghl_poke_timer, ghl_magic_poke, 0); @@ -3068,6 +3072,10 @@ static int sony_probe(struct hid_device } return ret; + +err: + hid_hw_stop(hdev); + return ret; } static void sony_remove(struct hid_device *hdev) Patches currently in stable-queue which might be from benjamin.tissoires@xxxxxxxxxx are queue-5.15/hid-wacom-fix-problems-when-device-is-not-a-valid-usb-device.patch queue-5.15/hid-add-usb_hid-dependancy-to-hid-prodikeys.patch queue-5.15/hid-add-usb_hid-dependancy-to-hid-chicony.patch queue-5.15/hid-add-hid_is_usb-function-to-make-it-simpler-for-usb-detection.patch queue-5.15/hid-add-usb_hid-dependancy-on-some-usb-hid-drivers.patch queue-5.15/hid-check-for-valid-usb-device-for-many-hid-drivers.patch queue-5.15/hid-sony-fix-error-path-in-probe.patch queue-5.15/hid-intel-ish-hid-ipc-only-enable-irq-wakeup-when-requested.patch queue-5.15/hid-google-add-eel-usb-id.patch queue-5.15/hid-bigbenff-prevent-null-pointer-dereference.patch