summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2020-05-28 18:20:37 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-10 21:34:59 +0200
commitc6f79b7b6e26b153379c2aa552a4219aa6b3166d (patch)
tree102cff15b0d8481b34117bf59b757eea5d779e45
parented9ab2c2aa46031d7b121a1eee99412769a8649f (diff)
downloadlinux-stable-c6f79b7b6e26b153379c2aa552a4219aa6b3166d.tar.gz
linux-stable-c6f79b7b6e26b153379c2aa552a4219aa6b3166d.tar.bz2
linux-stable-c6f79b7b6e26b153379c2aa552a4219aa6b3166d.zip
NFC: st21nfca: add missed kfree_skb() in an error path
[ Upstream commit 3decabdc714ca56c944f4669b4cdec5c2c1cea23 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/nfc/st21nfca/dep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c
index fd08be2917e6..7399eb2c5e1d 100644
--- a/drivers/nfc/st21nfca/dep.c
+++ b/drivers/nfc/st21nfca/dep.c
@@ -184,8 +184,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;