diff options
| author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-23 15:23:43 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-17 13:47:45 +0200 |
| commit | 818c725c12417b9996011d9e33e4032974b5a38c (patch) | |
| tree | 79c1fcdb9117a419db35abaa55ced40eb32c4402 /drivers/nfc | |
| parent | 0faee7f8c2366b3536fa32643f70ebe74c52bde2 (diff) | |
| download | linux-818c725c12417b9996011d9e33e4032974b5a38c.tar.gz linux-818c725c12417b9996011d9e33e4032974b5a38c.tar.bz2 linux-818c725c12417b9996011d9e33e4032974b5a38c.zip | |
NFC: st95hf: Fix memleak in st95hf_in_send_cmd
[ Upstream commit f97c04c316d8fea16dca449fdfbe101fbdfee6a2 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/nfc')
| -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, |
