summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@linux.intel.com>2012-11-15 21:24:28 +0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-20 03:09:26 +0400
commit5b412fd11c918171c98a253d8a3484afa9f69ca5 (patch)
treeab0fd2f2f58146a2c26d1ee415917b006577bdd0 /drivers/nfc
parent70418e6efcf4f8652cc08e3f2ab8ae35f0948fd9 (diff)
downloadlinux-5b412fd11c918171c98a253d8a3484afa9f69ca5.tar.xz
NFC: Fix pn533 target mode memory leak
In target mode, sent sk_buff were not freed in pn533_tm_send_complete Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn533.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 807bbb8e82d9..30ae18a03a9c 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -2077,8 +2077,12 @@ error:
static int pn533_tm_send_complete(struct pn533 *dev, void *arg,
u8 *params, int params_len)
{
+ struct sk_buff *skb_out = arg;
+
nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
+ dev_kfree_skb(skb_out);
+
if (params_len < 0) {
nfc_dev_err(&dev->interface->dev,
"Error %d when sending data",
@@ -2116,7 +2120,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame,
dev->in_maxlen, pn533_tm_send_complete,
- NULL, GFP_KERNEL);
+ skb, GFP_KERNEL);
if (rc) {
nfc_dev_err(&dev->interface->dev,
"Error %d when trying to send data", rc);