Skip to content

Commit

Permalink
uwb: hwa-rc: fix memory leak at probe
Browse files Browse the repository at this point in the history
[ Upstream commit 11b7178 ]

hwarc_probe() allocates memory for hwarc, but does not free it
if uwb_rc_add() or hwarc_get_version() fail.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Druidos authored and gregkh committed Oct 4, 2018
1 parent 16d5a6d commit ee6dc27
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/uwb/hwa-rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ static int hwarc_probe(struct usb_interface *iface,
error_rc_add:
usb_put_intf(iface);
usb_put_dev(hwarc->usb_dev);
kfree(hwarc);
error_alloc:
uwb_rc_put(uwb_rc);
error_rc_alloc:
Expand Down

0 comments on commit ee6dc27

Please sign in to comment.