ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karthikeyan Periyasamy <periyasa@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: Karthikeyan Periyasamy <periyasa@codeaurora.org>
Subject: [PATCH] ath11k: fix memory leak in testmode
Date: Tue, 16 Jul 2019 19:34:32 +0530	[thread overview]
Message-ID: <1563285872-13408-1-git-send-email-periyasa@codeaurora.org> (raw)

when ath11k_wmi_cmd_send() fails, caller need to free up the skb.
In ath11k_tm_cmd_wmi(), skb free not happen when wmi command send
fails. so free up the skb in the error case.

Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/testmode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath11k/testmode.c b/drivers/net/wireless/ath/ath11k/testmode.c
index 96ed2d2..9274b6c 100644
--- a/drivers/net/wireless/ath/ath11k/testmode.c
+++ b/drivers/net/wireless/ath/ath11k/testmode.c
@@ -160,6 +160,7 @@ static int ath11k_tm_cmd_wmi(struct ath11k *ar, struct nlattr *tb[])
 
 	ret = ath11k_wmi_cmd_send(wmi, skb, cmd_id);
 	if (ret) {
+		dev_kfree_skb(skb);
 		ath11k_warn(ar->ab, "failed to transmit wmi command (testmode): %d\n",
 			    ret);
 		goto out;
-- 
1.9.1


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

             reply	other threads:[~2019-07-16 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 14:04 Karthikeyan Periyasamy [this message]
2019-07-17 12:30 ` [PATCH] ath11k: fix memory leak in testmode Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1563285872-13408-1-git-send-email-periyasa@codeaurora.org \
    --to=periyasa@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox