Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ath9k_htc: release allocated buffer if timed out
@ 2019-09-06 18:26 Navid Emamdoost
  2019-09-10 13:29 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Emamdoost @ 2019-09-06 18:26 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: emamd001, smccaman, kjlu, Navid Emamdoost, QCA ath9k Development,
	Kalle Valo, David S. Miller, linux-wireless, netdev,
	linux-kernel

In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service
if time out happens, the allocated buffer needs to be released.
Otherwise there will be memory leak.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/net/wireless/ath/ath9k/htc_hst.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 1bf63a4efb4c..d091c8ebdcf0 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -170,6 +170,7 @@ static int htc_config_pipe_credits(struct htc_target *target)
 	time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
 	if (!time_left) {
 		dev_err(target->dev, "HTC credit config timeout\n");
+		kfree_skb(skb);
 		return -ETIMEDOUT;
 	}
 
@@ -205,6 +206,7 @@ static int htc_setup_complete(struct htc_target *target)
 	time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
 	if (!time_left) {
 		dev_err(target->dev, "HTC start timeout\n");
+		kfree_skb(skb);
 		return -ETIMEDOUT;
 	}
 
@@ -277,6 +279,7 @@ int htc_connect_service(struct htc_target *target,
 	if (!time_left) {
 		dev_err(target->dev, "Service connection timeout for: %d\n",
 			service_connreq->service_id);
+		kfree_skb(skb);
 		return -ETIMEDOUT;
 	}
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath9k_htc: release allocated buffer if timed out
  2019-09-06 18:26 [PATCH] ath9k_htc: release allocated buffer if timed out Navid Emamdoost
@ 2019-09-10 13:29 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-09-10 13:29 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: unlisted-recipients:; (no To-header on input) emamd001, smccaman,
	kjlu, Navid Emamdoost, QCA ath9k Development, David S. Miller,
	linux-wireless, netdev, linux-kernel

Navid Emamdoost <navid.emamdoost@gmail.com> wrote:

> In htc_config_pipe_credits, htc_setup_complete, and htc_connect_service
> if time out happens, the allocated buffer needs to be released.
> Otherwise there will be memory leak.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

853acf7caf10 ath9k_htc: release allocated buffer if timed out

-- 
https://patchwork.kernel.org/patch/11135781/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-06 18:26 [PATCH] ath9k_htc: release allocated buffer if timed out Navid Emamdoost
2019-09-10 13:29 ` Kalle Valo

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox