1
0
Fork 0

ath10k: Release some resources in an error handling path

[ Upstream commit 6364e693f4 ]

Should an error occur after calling 'ath10k_usb_create()', it should be
undone by a corresponding 'ath10k_usb_destroy()' call

Fixes: 4db66499df ("ath10k: add initial USB support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201122170358.1346065-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Christophe JAILLET 2020-11-24 17:59:18 +02:00 committed by Greg Kroah-Hartman
parent 6b6edd2c07
commit a3ac7dd8b1
1 changed files with 4 additions and 1 deletions

View File

@ -1023,7 +1023,7 @@ static int ath10k_usb_probe(struct usb_interface *interface,
ret = ath10k_core_register(ar, &bus_params);
if (ret) {
ath10k_warn(ar, "failed to register driver core: %d\n", ret);
goto err;
goto err_usb_destroy;
}
/* TODO: remove this once USB support is fully implemented */
@ -1031,6 +1031,9 @@ static int ath10k_usb_probe(struct usb_interface *interface,
return 0;
err_usb_destroy:
ath10k_usb_destroy(ar);
err:
ath10k_core_destroy(ar);