Commit 400e0208 authored by John W. Linville's avatar John W. Linville

Merge tag 'nfc-fixes-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-3.0

Samuel says:

"This is the first pull request for 3.7 NFC fixes.

We mostly have pn533 fixes here, 2 memory leaks and an early unlocking fix.
Moreover, we also have an LLCP adapter linked list insertion fix."
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parents 65210946 5b412fd1
...@@ -698,13 +698,14 @@ static void pn533_wq_cmd(struct work_struct *work) ...@@ -698,13 +698,14 @@ static void pn533_wq_cmd(struct work_struct *work)
cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue); cmd = list_first_entry(&dev->cmd_queue, struct pn533_cmd, queue);
list_del(&cmd->queue);
mutex_unlock(&dev->cmd_lock); mutex_unlock(&dev->cmd_lock);
__pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame, __pn533_send_cmd_frame_async(dev, cmd->out_frame, cmd->in_frame,
cmd->in_frame_len, cmd->cmd_complete, cmd->in_frame_len, cmd->cmd_complete,
cmd->arg, cmd->flags); cmd->arg, cmd->flags);
list_del(&cmd->queue);
kfree(cmd); kfree(cmd);
} }
...@@ -1678,11 +1679,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev, ...@@ -1678,11 +1679,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,
static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
u8 *params, int params_len) u8 *params, int params_len)
{ {
struct pn533_cmd_jump_dep *cmd;
struct pn533_cmd_jump_dep_response *resp; struct pn533_cmd_jump_dep_response *resp;
struct nfc_target nfc_target; struct nfc_target nfc_target;
u8 target_gt_len; u8 target_gt_len;
int rc; int rc;
struct pn533_cmd_jump_dep *cmd = (struct pn533_cmd_jump_dep *)arg;
u8 active = cmd->active;
kfree(arg);
if (params_len == -ENOENT) { if (params_len == -ENOENT) {
nfc_dev_dbg(&dev->interface->dev, ""); nfc_dev_dbg(&dev->interface->dev, "");
...@@ -1704,7 +1708,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, ...@@ -1704,7 +1708,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
} }
resp = (struct pn533_cmd_jump_dep_response *) params; resp = (struct pn533_cmd_jump_dep_response *) params;
cmd = (struct pn533_cmd_jump_dep *) arg;
rc = resp->status & PN533_CMD_RET_MASK; rc = resp->status & PN533_CMD_RET_MASK;
if (rc != PN533_CMD_RET_SUCCESS) { if (rc != PN533_CMD_RET_SUCCESS) {
nfc_dev_err(&dev->interface->dev, nfc_dev_err(&dev->interface->dev,
...@@ -1734,7 +1737,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg, ...@@ -1734,7 +1737,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
if (rc == 0) if (rc == 0)
rc = nfc_dep_link_is_up(dev->nfc_dev, rc = nfc_dep_link_is_up(dev->nfc_dev,
dev->nfc_dev->targets[0].idx, dev->nfc_dev->targets[0].idx,
!cmd->active, NFC_RF_INITIATOR); !active, NFC_RF_INITIATOR);
return 0; return 0;
} }
...@@ -1819,12 +1822,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target, ...@@ -1819,12 +1822,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame, rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
dev->in_maxlen, pn533_in_dep_link_up_complete, dev->in_maxlen, pn533_in_dep_link_up_complete,
cmd, GFP_KERNEL); cmd, GFP_KERNEL);
if (rc) if (rc < 0)
goto out; kfree(cmd);
out:
kfree(cmd);
return rc; return rc;
} }
...@@ -2078,8 +2077,12 @@ static int pn533_transceive(struct nfc_dev *nfc_dev, ...@@ -2078,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",
...@@ -2117,7 +2120,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) ...@@ -2117,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);
......
...@@ -1210,7 +1210,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev) ...@@ -1210,7 +1210,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)
local->remote_miu = LLCP_DEFAULT_MIU; local->remote_miu = LLCP_DEFAULT_MIU;
local->remote_lto = LLCP_DEFAULT_LTO; local->remote_lto = LLCP_DEFAULT_LTO;
list_add(&llcp_devices, &local->list); list_add(&local->list, &llcp_devices);
return 0; return 0;
} }
......
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