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

Commit f8036965 authored by Rajkumar Manoharan's avatar Rajkumar Manoharan Committed by John W. Linville
Browse files

ath9k_htc: fix memory leak in ath9k_hif_usb_alloc_urbs



Failure cases within ath9k_hif_usb_alloc_urbs are failed
to release allocated memory.

Signed-off-by: default avatarRajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e4c06472
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -730,13 +730,17 @@ static int ath9k_hif_usb_alloc_urbs(struct hif_device_usb *hif_dev)

	/* RX */
	if (ath9k_hif_usb_alloc_rx_urbs(hif_dev) < 0)
		goto err;
		goto err_rx;

	/* Register Read */
	if (ath9k_hif_usb_alloc_reg_in_urb(hif_dev) < 0)
		goto err;
		goto err_reg;

	return 0;
err_reg:
	ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
err_rx:
	ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
err:
	return -ENOMEM;
}