diff options
author | Eric Lapuyade <eric.lapuyade@linux.intel.com> | 2012-12-04 10:44:25 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-01-09 18:51:50 -0500 |
commit | 924d4a023ee6da2e40c78578829e68bcbabee2dd (patch) | |
tree | ae6bfa8b03c8b6db301ffaae562f5e398e786021 | |
parent | 40d06d3647ea872a7346be1f6859f18cd0fe08d3 (diff) |
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>
-rw-r--r-- | drivers/nfc/pn544/pn544.c | 10 | ||||
-rw-r--r-- | net/nfc/hci/core.c | 6 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/nfc/pn544/pn544.c b/drivers/nfc/pn544/pn544.c index 9349c548e8dc..cd8fb16f5416 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, | |||
675 | 675 | ||
676 | static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) | 676 | static int pn544_hci_tm_send(struct nfc_hci_dev *hdev, struct sk_buff *skb) |
677 | { | 677 | { |
678 | int r; | ||
679 | |||
678 | /* Set default false for multiple information chaining */ | 680 | /* Set default false for multiple information chaining */ |
679 | *skb_push(skb, 1) = 0; | 681 | *skb_push(skb, 1) = 0; |
680 | 682 | ||
681 | return nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, | 683 | r = nfc_hci_send_event(hdev, PN544_RF_READER_NFCIP1_TARGET_GATE, |
682 | PN544_HCI_EVT_SND_DATA, skb->data, skb->len); | 684 | PN544_HCI_EVT_SND_DATA, skb->data, skb->len); |
685 | |||
686 | kfree_skb(skb); | ||
687 | |||
688 | return r; | ||
683 | } | 689 | } |
684 | 690 | ||
685 | static int pn544_hci_check_presence(struct nfc_hci_dev *hdev, | 691 | static int pn544_hci_check_presence(struct nfc_hci_dev *hdev, |
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c index 0430f3086e41..d9190da4a403 100644 --- a/net/nfc/hci/core.c +++ b/net/nfc/hci/core.c | |||
@@ -675,8 +675,10 @@ static int hci_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) | |||
675 | 675 | ||
676 | if (hdev->ops->tm_send) | 676 | if (hdev->ops->tm_send) |
677 | return hdev->ops->tm_send(hdev, skb); | 677 | return hdev->ops->tm_send(hdev, skb); |
678 | else | 678 | |
679 | return -ENOTSUPP; | 679 | kfree_skb(skb); |
680 | |||
681 | return -ENOTSUPP; | ||
680 | } | 682 | } |
681 | 683 | ||
682 | static int hci_check_presence(struct nfc_dev *nfc_dev, | 684 | static int hci_check_presence(struct nfc_dev *nfc_dev, |