Skip to content

Commit

Permalink
NFC: st95hf: Fix memleak in st95hf_in_send_cmd
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dinghao Liu authored and David S. Miller committed Aug 25, 2020
1 parent 799b871 commit f97c04c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nfc/st95hf/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f97c04c

Please sign in to comment.