aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-09-03 18:04:00 +0200
committerJiri Kosina <jkosina@suse.cz>2023-09-04 11:14:22 +0200
commite1cd4004cde7c9b694bbdd8def0e02288ee58c74 (patch)
treee5ea3aa5df5edebefa941f59c47cc589c0619989 /drivers/hid
parent29aa98d0fe013e2ab62aae4266231b7fb05d47a2 (diff)
downloadlinux-e1cd4004cde7c9b694bbdd8def0e02288ee58c74.tar.gz
HID: sony: Fix a potential memory leak in sony_probe()
If an error occurs after a successful usb_alloc_urb() call, usb_free_urb() should be called. Fixes: fb1a79a6b6e1 ("HID: sony: fix freeze when inserting ghlive ps3/wii dongles") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-sony.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index dd942061fd775..a02046a78b2da 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2155,6 +2155,9 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
return ret;
err:
+ if (sc->ghl_urb)
+ usb_free_urb(sc->ghl_urb);
+
hid_hw_stop(hdev);
return ret;
}