aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2012-10-29 09:04:43 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-19 18:09:26 -0500
commit770f750bc2b8312489c8e45306f551d08a319d3c (patch)
tree2d7cdc8555287311e9b1e7003e938ca70aa4c02c /drivers
parent60ad07ab6bc86f48b6ebda1788d79ca5f88d824c (diff)
NFC: pn533: Fix use after free
cmd was freed in pn533_dep_link_up regardless of pn533_send_cmd_frame_async return code. Cmd is passed as argument to pn533_in_dep_link_up_complete callback and should be freed there. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nfc/pn533.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 328f2b66491e..84a2e77ab5de 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -1820,12 +1820,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
1820 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, 1820 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1821 dev->in_maxlen, pn533_in_dep_link_up_complete, 1821 dev->in_maxlen, pn533_in_dep_link_up_complete,
1822 cmd, GFP_KERNEL); 1822 cmd, GFP_KERNEL);
1823 if (rc) 1823 if (rc < 0)
1824 goto out; 1824 kfree(cmd);
1825
1826
1827out:
1828 kfree(cmd);
1829 1825
1830 return rc; 1826 return rc;
1831} 1827}