Skip to content

Commit b328dd0

Browse files
author
Jiri Kosina
committed
HID: sony: remove duplicate NULL check before calling usb_free_urb()
usb_free_urb() does the NULL check itself, so there is no need to duplicate it prior to calling. Reported-by: kernel test robot <[email protected]> Fixes: e1cd400 ("HID: sony: Fix a potential memory leak in sony_probe()") Signed-off-by: Jiri Kosina <[email protected]>
1 parent 95ea4d9 commit b328dd0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/hid/hid-sony.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,8 +2155,7 @@ 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);
2158+
usb_free_urb(sc->ghl_urb);
21602159

21612160
hid_hw_stop(hdev);
21622161
return ret;

0 commit comments

Comments
 (0)