diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-09-03 18:04:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-10 21:59:06 +0200 |
commit | bb0707fde7492121917fd9ddb43829e96ec0bb9e (patch) | |
tree | ae43d0963f08947e3a82a8c0a2e7a3853c8f2301 | |
parent | 8afbacf6191985f175b15bc625417d1e117b020a (diff) | |
download | linux-stable-bb0707fde7492121917fd9ddb43829e96ec0bb9e.tar.gz linux-stable-bb0707fde7492121917fd9ddb43829e96ec0bb9e.tar.bz2 linux-stable-bb0707fde7492121917fd9ddb43829e96ec0bb9e.zip |
HID: sony: Fix a potential memory leak in sony_probe()
[ Upstream commit e1cd4004cde7c9b694bbdd8def0e02288ee58c74 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/hid/hid-sony.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 60ec2b29d54d..3ab18811b009 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -3074,6 +3074,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; } |