projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f75c291
)
NFC: pn533: Fix memleak while scheduling next cmd
author
Waldemar Rymarkiewicz
<
[email protected]
>
Wed, 3 Apr 2013 06:02:03 +0000
(08:02 +0200)
committer
Samuel Ortiz
<
[email protected]
>
Thu, 11 Apr 2013 14:29:02 +0000
(16:29 +0200)
In case of error from __pn533_send_frame_async() while sending
next cmd from the queue (cmd_wq), cmd->req, cmd->resp and
cmd->arg pointers won't be freed.
Signed-off-by: Waldemar Rymarkiewicz <
[email protected]
>
Signed-off-by: Samuel Ortiz <
[email protected]
>
drivers/nfc/pn533.c
patch
|
blob
|
history
diff --git
a/drivers/nfc/pn533.c
b/drivers/nfc/pn533.c
index 24ffbe04108ba2a820e1a714cc00c3dfc7c4cd80..48902e58cacb9d256fcfd6b4d6f5619a337f9531 100644
(file)
--- a/
drivers/nfc/pn533.c
+++ b/
drivers/nfc/pn533.c
@@
-886,6
+886,7
@@
static void pn533_wq_cmd(struct work_struct *work)
{
struct pn533 *dev = container_of(work, struct pn533, cmd_work);
struct pn533_cmd *cmd;
+ int rc;
mutex_lock(&dev->cmd_lock);
@@
-901,8
+902,13
@@
static void pn533_wq_cmd(struct work_struct *work)
mutex_unlock(&dev->cmd_lock);
- __pn533_send_frame_async(dev, cmd->req, cmd->resp, cmd->resp_len,
- pn533_send_async_complete, cmd->arg);
+ rc = __pn533_send_frame_async(dev, cmd->req, cmd->resp, cmd->resp_len,
+ pn533_send_async_complete, cmd->arg);
+ if (rc < 0) {
+ dev_kfree_skb(cmd->req);
+ dev_kfree_skb(cmd->resp);
+ kfree(cmd->arg);
+ }
kfree(cmd);
}