1
0
Fork 0

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>
zero-sugar-mainline-defconfig
Dinghao Liu 2020-08-23 15:23:43 +08:00 committed by David S. Miller
parent 799b87120c
commit f97c04c316
1 changed files with 1 additions and 1 deletions

View File

@ -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,