Commit 8d35eff7 authored by Dinghao Liu's avatar Dinghao Liu Committed by Greg Kroah-Hartman

NFC: st95hf: Fix memleak in st95hf_in_send_cmd

[ Upstream commit f97c04c3 ]

When down_killable() fails, skb_resp should be freed
just like when st95hf_spi_send() fails.
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a60936c7
......@@ -981,7 +981,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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment