diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2020-05-28 13:20:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-30 03:04:14 +0300 |
commit | 3decabdc714ca56c944f4669b4cdec5c2c1cea23 (patch) | |
tree | 3205aaf788eb77fea89e18bfc813e82b0e817d9f /drivers/nfc/st21nfca | |
parent | 96d10d5b192e7f064457fd957e6a3ce8c2dce4b4 (diff) | |
download | linux-3decabdc714ca56c944f4669b4cdec5c2c1cea23.tar.xz |
NFC: st21nfca: add missed kfree_skb() in an error path
st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path.
Add the missed function call to fix it.
Fixes: 1892bf844ea0 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nfc/st21nfca')
-rw-r--r-- | drivers/nfc/st21nfca/dep.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c index a1d69f9b2d4a..0b9ca6d20ffa 100644 --- a/drivers/nfc/st21nfca/dep.c +++ b/drivers/nfc/st21nfca/dep.c @@ -173,8 +173,10 @@ static int st21nfca_tm_send_atr_res(struct nfc_hci_dev *hdev, memcpy(atr_res->gbi, atr_req->gbi, gb_len); r = nfc_set_remote_general_bytes(hdev->ndev, atr_res->gbi, gb_len); - if (r < 0) + if (r < 0) { + kfree_skb(skb); return r; + } } info->dep_info.curr_nfc_dep_pni = 0; |