提交 f97c04c3 编写于 作者: D Dinghao Liu 提交者: David S. Miller

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: NDinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 799b8712
...@@ -966,7 +966,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, ...@@ -966,7 +966,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
rc = down_killable(&stcontext->exchange_lock); rc = down_killable(&stcontext->exchange_lock);
if (rc) { if (rc) {
WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n"); 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, rc = st95hf_spi_send(&stcontext->spicontext, skb->data,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册