]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
NFC: st21nfca: add missed kfree_skb() in an error path
authorChuhong Yuan <hslester96@gmail.com>
Thu, 28 May 2020 10:20:37 +0000 (18:20 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 May 2020 00:04:14 +0000 (17:04 -0700)
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>
drivers/nfc/st21nfca/dep.c

index a1d69f9b2d4a469acf00503e04f88fc07e9bc528..0b9ca6d20ffadc48e36d15185f2272f23f6024fd 100644 (file)
@@ -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;