From: Dinghao Liu Date: Sun, 23 Aug 2020 07:23:43 +0000 (+0800) Subject: NFC: st95hf: Fix memleak in st95hf_in_send_cmd X-Git-Tag: v5.9-rc4~28^2~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f97c04c316d8fea16dca449fdfbe101fbdfee6a2;p=thirdparty%2Fkernel%2Flinux.git NFC: st95hf: Fix memleak in st95hf_in_send_cmd When down_killable() fails, skb_resp should be freed just like when st95hf_spi_send() fails. Signed-off-by: Dinghao Liu Signed-off-by: David S. Miller --- diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c index 9642971e89cea..4578547659839 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,