aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc/pn533.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nfc/pn533.c')
-rw-r--r--drivers/nfc/pn533.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 24ffbe04108b..48902e58cacb 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -886,6 +886,7 @@ static void pn533_wq_cmd(struct work_struct *work)
886{ 886{
887 struct pn533 *dev = container_of(work, struct pn533, cmd_work); 887 struct pn533 *dev = container_of(work, struct pn533, cmd_work);
888 struct pn533_cmd *cmd; 888 struct pn533_cmd *cmd;
889 int rc;
889 890
890 mutex_lock(&dev->cmd_lock); 891 mutex_lock(&dev->cmd_lock);
891 892
@@ -901,8 +902,13 @@ static void pn533_wq_cmd(struct work_struct *work)
901 902
902 mutex_unlock(&dev->cmd_lock); 903 mutex_unlock(&dev->cmd_lock);
903 904
904 __pn533_send_frame_async(dev, cmd->req, cmd->resp, cmd->resp_len, 905 rc = __pn533_send_frame_async(dev, cmd->req, cmd->resp, cmd->resp_len,
905 pn533_send_async_complete, cmd->arg); 906 pn533_send_async_complete, cmd->arg);
907 if (rc < 0) {
908 dev_kfree_skb(cmd->req);
909 dev_kfree_skb(cmd->resp);
910 kfree(cmd->arg);
911 }
906 912
907 kfree(cmd); 913 kfree(cmd);
908} 914}