diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-23 09:23:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-25 02:34:25 +0200 |
commit | f97c04c316d8fea16dca449fdfbe101fbdfee6a2 (patch) | |
tree | 792c9273222a916878d265c2e77a9d8906e54450 | |
parent | Merge branch 'MAINTAINERS-Remove-self-from-PHY-LIBRARY' (diff) | |
download | linux-f97c04c316d8fea16dca449fdfbe101fbdfee6a2.tar.xz linux-f97c04c316d8fea16dca449fdfbe101fbdfee6a2.zip |
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 <dinghao.liu@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/nfc/st95hf/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |