Commit 924d4a02 authored by Eric Lapuyade's avatar Eric Lapuyade Committed by Samuel Ortiz

NFC: Fixed skb leak in tm_send() nfc and hci ops implementations

Signed-off-by: default avatarEric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 40d06d36
...@@ -675,11 +675,17 @@ static int pn544_hci_im_transceive(struct nfc_hci_dev *hdev, ...@@ -675,11 +675,17 @@ static int pn544_hci_im_transceive(struct nfc_hci_dev *hdev,
static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb)
{ {
int r;
/* Set default false for multiple information chaining */ /* Set default false for multiple information chaining */
*skb_push(skb, 1) = 0; *skb_push(skb, 1) = 0;
return nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, r = nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE,
PN544_HCI_EVT_SND_DATA, skb->data, skb->len); PN544_HCI_EVT_SND_DATA, skb->data, skb->len);
kfree_skb(skb);
return r;
} }
static int pn544_hci_check_presence(struct nfc_hci_dev *hdev, static int pn544_hci_check_presence(struct nfc_hci_dev *hdev,
......
...@@ -675,7 +675,9 @@ static int hci_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) ...@@ -675,7 +675,9 @@ static int hci_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
if (hdev->ops->tm_send) if (hdev->ops->tm_send)
return hdev->ops->tm_send(hdev, skb); return hdev->ops->tm_send(hdev, skb);
else
kfree_skb(skb);
return -ENOTSUPP; return -ENOTSUPP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment