Commit 5b412fd1 authored by Thierry Escande's avatar Thierry Escande Committed by Samuel Ortiz

NFC: Fix pn533 target mode memory leak

In target mode, sent sk_buff were not freed in pn533_tm_send_complete
Signed-off-by: default avatarThierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 70418e6e
...@@ -2077,8 +2077,12 @@ static int pn533_transceive(struct nfc_dev *nfc_dev, ...@@ -2077,8 +2077,12 @@ static int pn533_transceive(struct nfc_dev *nfc_dev,
static int pn533_tm_send_complete(struct pn533 *dev, void *arg, static int pn533_tm_send_complete(struct pn533 *dev, void *arg,
u8 *params, int params_len) u8 *params, int params_len)
{ {
struct sk_buff *skb_out = arg;
nfc_dev_dbg(&dev->interface->dev, "%s", __func__); nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
dev_kfree_skb(skb_out);
if (params_len < 0) { if (params_len < 0) {
nfc_dev_err(&dev->interface->dev, nfc_dev_err(&dev->interface->dev,
"Error %d when sending data", "Error %d when sending data",
...@@ -2116,7 +2120,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) ...@@ -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, rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame,
dev->in_maxlen, pn533_tm_send_complete, dev->in_maxlen, pn533_tm_send_complete,
NULL, GFP_KERNEL); skb, GFP_KERNEL);
if (rc) { if (rc) {
nfc_dev_err(&dev->interface->dev, nfc_dev_err(&dev->interface->dev,
"Error %d when trying to send data", rc); "Error %d when trying to send data", rc);
......
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