summaryrefslogtreecommitdiff
path: root/drivers/nfc/pn544
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@linux.intel.com>2012-12-04 16:44:25 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-01-10 00:51:50 +0100
commit924d4a023ee6da2e40c78578829e68bcbabee2dd (patch)
treeae6bfa8b03c8b6db301ffaae562f5e398e786021 /drivers/nfc/pn544
parent40d06d3647ea872a7346be1f6859f18cd0fe08d3 (diff)
downloadlinux-3.10-924d4a023ee6da2e40c78578829e68bcbabee2dd.tar.gz
linux-3.10-924d4a023ee6da2e40c78578829e68bcbabee2dd.tar.bz2
linux-3.10-924d4a023ee6da2e40c78578829e68bcbabee2dd.zip
NFC: Fixed skb leak in tm_send() nfc and hci ops implementations
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/pn544')
-rw-r--r--drivers/nfc/pn544/pn544.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c
index 9349c548e8d..cd8fb16f541 100644
--- a/drivers/nfc/pn544/pn544.c
+++ b/drivers/nfc/pn544/pn544.c
@@ -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)
{
+ int r;
+
/* Set default false for multiple information chaining */
*skb_push(skb, 1) = 0;
- return nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE,
- PN544_HCI_EVT_SND_DATA, skb->data, skb->len);
+ r = nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE,
+ 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,