Skip to content

Commit

Permalink
NFC: st21nfca: add missed kfree_skb() in an error path
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
WillLester authored and davem330 committed May 30, 2020
1 parent 96d10d5 commit 3decabd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nfc/st21nfca/dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3decabd

Please sign in to comment.