Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd2c756e authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman
Browse files

ath10k: Release some resources in an error handling path



[ Upstream commit 6364e693f4a7a89a2fb3dd2cbd6cc06d5fd6e26d ]

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

Fixes: 4db66499 ("ath10k: add initial USB support")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201122170358.1346065-1-christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 682a73cd
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1032,7 +1032,7 @@ static int ath10k_usb_probe(struct usb_interface *interface,
	ret = ath10k_core_register(ar, chip_id);
	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 */
@@ -1040,6 +1040,9 @@ static int ath10k_usb_probe(struct usb_interface *interface,

	return 0;

err_usb_destroy:
	ath10k_usb_destroy(ar);

err:
	ath10k_core_destroy(ar);