Skip to content

Commit 3decabd

Browse files
WillLesterdavem330
authored andcommitted
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: 1892bf8 ("NFC: st21nfca: Adding P2P support to st21nfca in Initiator & Target mode") Signed-off-by: Chuhong Yuan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 96d10d5 commit 3decabd

File tree

1 file changed

+3
-1
lines changed
  • drivers/nfc/st21nfca

1 file changed

+3
-1
lines changed

drivers/nfc/st21nfca/dep.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ static int st21nfca_tm_send_atr_res(struct nfc_hci_dev *hdev,
173173
memcpy(atr_res->gbi, atr_req->gbi, gb_len);
174174
r = nfc_set_remote_general_bytes(hdev->ndev, atr_res->gbi,
175175
gb_len);
176-
if (r < 0)
176+
if (r < 0) {
177+
kfree_skb(skb);
177178
return r;
179+
}
178180
}
179181

180182
info->dep_info.curr_nfc_dep_pni = 0;

0 commit comments

Comments
 (0)