Skip to content

Commit

Permalink
HID: sony: remove duplicate NULL check before calling usb_free_urb()
Browse files Browse the repository at this point in the history
[ Upstream commit b328dd0 ]

usb_free_urb() does the NULL check itself, so there is no need to duplicate
it prior to calling.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: e1cd400 ("HID: sony: Fix a potential memory leak in sony_probe()")
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Jiri Kosina authored and gregkh committed Oct 10, 2023
1 parent 40d609b commit 07c6338
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/hid/hid-sony.c
Original file line number Diff line number Diff line change
Expand Up @@ -3074,8 +3074,7 @@ 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);
usb_free_urb(sc->ghl_urb);

hid_hw_stop(hdev);
return ret;
Expand Down

0 comments on commit 07c6338

Please sign in to comment.