Skip to content

Commit

Permalink
ath10k: Release some resources in an error handling path
Browse files Browse the repository at this point in the history
[ Upstream commit 6364e69 ]

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

Fixes: 4db6649 ("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>
  • Loading branch information
tititiou36 authored and gregkh committed Dec 30, 2020
1 parent 6b6edd2 commit a3ac7dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/wireless/ath/ath10k/usb.c
Expand Up @@ -1023,14 +1023,17 @@ 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 */
ath10k_warn(ar, "Warning: ath10k USB support is incomplete, don't expect anything to work!\n");

return 0;

err_usb_destroy:
ath10k_usb_destroy(ar);

err:
ath10k_core_destroy(ar);

Expand Down

0 comments on commit a3ac7dd

Please sign in to comment.