netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFC: st95hf: Fix memleak in st95hf_in_send_cmd
@ 2020-08-23  7:23 Dinghao Liu
  2020-08-25  0:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dinghao Liu @ 2020-08-23  7:23 UTC (permalink / raw)
  To: dinghao.liu, kjlu; +Cc: Colin Ian King, David S. Miller, netdev, linux-kernel

When down_killable() fails, skb_resp should be freed
just like when st95hf_spi_send() fails.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/nfc/st95hf/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 9642971e89ce..457854765983 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -966,7 +966,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
 	rc = down_killable(&stcontext->exchange_lock);
 	if (rc) {
 		WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n");
-		return rc;
+		goto free_skb_resp;
 	}
 
 	rc = st95hf_spi_send(&stcontext->spicontext, skb->data,
-- 
2.17.1


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

* Re: [PATCH] NFC: st95hf: Fix memleak in st95hf_in_send_cmd
  2020-08-23  7:23 [PATCH] NFC: st95hf: Fix memleak in st95hf_in_send_cmd Dinghao Liu
@ 2020-08-25  0:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-25  0:34 UTC (permalink / raw)
  To: dinghao.liu; +Cc: kjlu, colin.king, netdev, linux-kernel

From: Dinghao Liu <dinghao.liu@zju.edu.cn>
Date: Sun, 23 Aug 2020 15:23:43 +0800

> When down_killable() fails, skb_resp should be freed
> just like when st95hf_spi_send() fails.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Applied, thank you.

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

end of thread, other threads:[~2020-08-25  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-23  7:23 [PATCH] NFC: st95hf: Fix memleak in st95hf_in_send_cmd Dinghao Liu
2020-08-25  0:34 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).