Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Dinghao Liu and committed by
David S. Miller
f97c04c3 799b8712

+1 -1
+1 -1
drivers/nfc/st95hf/core.c
··· 966 966 rc = down_killable(&stcontext->exchange_lock); 967 967 if (rc) { 968 968 WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n"); 969 - return rc; 969 + goto free_skb_resp; 970 970 } 971 971 972 972 rc = st95hf_spi_send(&stcontext->spicontext, skb->data,