mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] NFC: st21nfca: add missed kfree_skb() in an error path
@ 2020-05-28 10:20 Chuhong Yuan
  2020-05-30  0:05 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2020-05-28 10:20 UTC (permalink / raw)
  Cc: Gustavo A . R . Silva, David S . Miller, Kate Stewart,
	Greg Kroah-Hartman, Thomas Gleixner, Samuel Ortiz,
	Christophe Ricard, netdev, linux-kernel, Chuhong Yuan

st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path.
Add the missed function call to fix it.

Fixes: 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/nfc/st21nfca/dep.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c
index a1d69f9b2d4a..0b9ca6d20ffa 100644
--- a/drivers/nfc/st21nfca/dep.c
+++ b/drivers/nfc/st21nfca/dep.c
@@ -173,8 +173,10 @@ static int st21nfca_tm_send_atr_res(struct nfc_hci_dev *hdev,
 		memcpy(atr_res->gbi, atr_req->gbi, gb_len);
 		r = nfc_set_remote_general_bytes(hdev->ndev, atr_res->gbi,
 						  gb_len);
-		if (r < 0)
+		if (r < 0) {
+			kfree_skb(skb);
 			return r;
+		}
 	}
 
 	info->dep_info.curr_nfc_dep_pni = 0;
-- 
2.26.2


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

* Re: [PATCH] NFC: st21nfca: add missed kfree_skb() in an error path
  2020-05-28 10:20 [PATCH] NFC: st21nfca: add missed kfree_skb() in an error path Chuhong Yuan
@ 2020-05-30  0:05 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-30  0:05 UTC (permalink / raw)
  To: hslester96
  Cc: gustavo, kstewart, gregkh, tglx, sameo, christophe.ricard,
	netdev, linux-kernel

From: Chuhong Yuan <hslester96@gmail.com>
Date: Thu, 28 May 2020 18:20:37 +0800

> st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path.
> Add the missed function call to fix it.
> 
> Fixes: 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>

Applied and queued up for -stable, thank you.

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

end of thread, other threads:[~2020-05-30  0:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 10:20 [PATCH] NFC: st21nfca: add missed kfree_skb() in an error path Chuhong Yuan
2020-05-30  0:05 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®