提交 90d5f81a 编写于 作者: C Christophe Ricard 提交者: Samuel Ortiz

NFC: st21nfca: Fix recursive fault when doing p2p in target mode.

This patch fix a previous patch introduce by commit	0a91e8ac

It is actually fixing a double free mistake in all st21nfca_tm_* function.
We decide to return directly in case of successful execution because skb
got already freed. In st21nfca_tm_recv_dep_req it got freed by nfc_tm_data_received.
Signed-off-by: NChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 ecc6522b
...@@ -861,19 +861,16 @@ static int st21nfca_hci_event_received(struct nfc_hci_dev *hdev, u8 gate, ...@@ -861,19 +861,16 @@ static int st21nfca_hci_event_received(struct nfc_hci_dev *hdev, u8 gate,
if (gate == ST21NFCA_RF_CARD_F_GATE) { if (gate == ST21NFCA_RF_CARD_F_GATE) {
r = st21nfca_tm_event_send_data(hdev, skb, gate); r = st21nfca_tm_event_send_data(hdev, skb, gate);
if (r < 0) if (r < 0)
goto exit; return r;
} else { return 0;
info->dep_info.curr_nfc_dep_pni = 0;
return 1;
} }
break; info->dep_info.curr_nfc_dep_pni = 0;
return 1;
default: default:
return 1; return 1;
} }
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
exit:
return r;
} }
static struct nfc_hci_ops st21nfca_hci_ops = { static struct nfc_hci_ops st21nfca_hci_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册