uwb: hwa-rc: fix memory leak at probe

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 <vasilyev@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Anton Vasilyev 2018-07-06 15:32:53 +03:00 committed by Greg Kroah-Hartman
parent 9920184d78
commit 11b71782c1
1 changed files with 1 additions and 0 deletions

View File

@ -873,6 +873,7 @@ error_get_version:
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: