Skip to content

Commit e1cd400

Browse files
tititiou36Jiri Kosina
authored andcommitted
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: fb1a79a ("HID: sony: fix freeze when inserting ghlive ps3/wii dongles") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 29aa98d commit e1cd400

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/hid/hid-sony.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,9 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
21552155
return ret;
21562156

21572157
err:
2158+
if (sc->ghl_urb)
2159+
usb_free_urb(sc->ghl_urb);
2160+
21582161
hid_hw_stop(hdev);
21592162
return ret;
21602163
}

0 commit comments

Comments
 (0)