aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-11-21 12:57:56 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-21 12:57:56 -0500
commitb3117494772d8f906625905c6e203af745ee3530 (patch)
treecc8960455f9e1f18d0939fddd0e96f349613f753 /drivers/nfc
parente2ff0498409af6f2023f91aba07b281e5e87ee15 (diff)
parent400e020892a9a20eea5d2c9bce8bfb312075c4ba (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c drivers/net/wireless/iwlwifi/pcie/tx.c
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/pn533.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index 18e279d3e836..ada681b01a17 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -702,13 +702,14 @@ static void pn533_wq_cmd(struct work_struct *work)
702 702
703 cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue); 703 cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue);
704 704
705 list_del(&cmd->queue);
706
705 mutex_unlock(&dev->cmd_lock); 707 mutex_unlock(&dev->cmd_lock);
706 708
707 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame, 709 __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame,
708 cmd->in_frame_len, cmd->cmd_complete, 710 cmd->in_frame_len, cmd->cmd_complete,
709 cmd->arg, cmd->flags); 711 cmd->arg, cmd->flags);
710 712
711 list_del(&cmd->queue);
712 kfree(cmd); 713 kfree(cmd);
713} 714}
714 715
@@ -1680,11 +1681,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,
1680static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, 1681static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1681 u8 *params, int params_len) 1682 u8 *params, int params_len)
1682{ 1683{
1683 struct pn533_cmd_jump_dep *cmd;
1684 struct pn533_cmd_jump_dep_response *resp; 1684 struct pn533_cmd_jump_dep_response *resp;
1685 struct nfc_target nfc_target; 1685 struct nfc_target nfc_target;
1686 u8 target_gt_len; 1686 u8 target_gt_len;
1687 int rc; 1687 int rc;
1688 struct pn533_cmd_jump_dep *cmd = (struct pn533_cmd_jump_dep *)arg;
1689 u8 active = cmd->active;
1690
1691 kfree(arg);
1688 1692
1689 if (params_len == -ENOENT) { 1693 if (params_len == -ENOENT) {
1690 nfc_dev_dbg(&dev->interface->dev, ""); 1694 nfc_dev_dbg(&dev->interface->dev, "");
@@ -1706,7 +1710,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1706 } 1710 }
1707 1711
1708 resp = (struct pn533_cmd_jump_dep_response *) params; 1712 resp = (struct pn533_cmd_jump_dep_response *) params;
1709 cmd = (struct pn533_cmd_jump_dep *) arg;
1710 rc = resp->status & PN533_CMD_RET_MASK; 1713 rc = resp->status & PN533_CMD_RET_MASK;
1711 if (rc != PN533_CMD_RET_SUCCESS) { 1714 if (rc != PN533_CMD_RET_SUCCESS) {
1712 nfc_dev_err(&dev->interface->dev, 1715 nfc_dev_err(&dev->interface->dev,
@@ -1736,7 +1739,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1736 if (rc == 0) 1739 if (rc == 0)
1737 rc = nfc_dep_link_is_up(dev->nfc_dev, 1740 rc = nfc_dep_link_is_up(dev->nfc_dev,
1738 dev->nfc_dev->targets[0].idx, 1741 dev->nfc_dev->targets[0].idx,
1739 !cmd->active, NFC_RF_INITIATOR); 1742 !active, NFC_RF_INITIATOR);
1740 1743
1741 return 0; 1744 return 0;
1742} 1745}
@@ -1821,12 +1824,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
1821 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, 1824 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1822 dev->in_maxlen, pn533_in_dep_link_up_complete, 1825 dev->in_maxlen, pn533_in_dep_link_up_complete,
1823 cmd, GFP_KERNEL); 1826 cmd, GFP_KERNEL);
1824 if (rc) 1827 if (rc < 0)
1825 goto out; 1828 kfree(cmd);
1826
1827
1828out:
1829 kfree(cmd);
1830 1829
1831 return rc; 1830 return rc;
1832} 1831}
@@ -2080,8 +2079,12 @@ error:
2080static int pn533_tm_send_complete(struct pn533 *dev, void *arg, 2079static int pn533_tm_send_complete(struct pn533 *dev, void *arg,
2081 u8 *params, int params_len) 2080 u8 *params, int params_len)
2082{ 2081{
2082 struct sk_buff *skb_out = arg;
2083
2083 nfc_dev_dbg(&dev->interface->dev, "%s", __func__); 2084 nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
2084 2085
2086 dev_kfree_skb(skb_out);
2087
2085 if (params_len < 0) { 2088 if (params_len < 0) {
2086 nfc_dev_err(&dev->interface->dev, 2089 nfc_dev_err(&dev->interface->dev,
2087 "Error %d when sending data", 2090 "Error %d when sending data",
@@ -2119,7 +2122,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
2119 2122
2120 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame, 2123 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame,
2121 dev->in_maxlen, pn533_tm_send_complete, 2124 dev->in_maxlen, pn533_tm_send_complete,
2122 NULL, GFP_KERNEL); 2125 skb, GFP_KERNEL);
2123 if (rc) { 2126 if (rc) {
2124 nfc_dev_err(&dev->interface->dev, 2127 nfc_dev_err(&dev->interface->dev,
2125 "Error %d when trying to send data", rc); 2128 "Error %d when trying to send data", rc);