Skip to content

Commit

Permalink
NFC: pn533: handle interrupted commands in pn533_recv_frame
Browse files Browse the repository at this point in the history
When pn533_recv_frame is called from within abort_command
context the current  dev->cmd is not guaranteed to be set.

Additionally on receiving an error status we can omit frame
checking and simply schedule the workqueue.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Michael Thalmeier authored and Samuel Ortiz committed May 9, 2016
1 parent c952f91 commit b31d510
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/nfc/pn533/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,8 +2016,16 @@ static int pn533_data_exchange_complete(struct pn533 *dev, void *_arg,
*/
void pn533_recv_frame(struct pn533 *dev, struct sk_buff *skb, int status)
{
if (!dev->cmd)
goto sched_wq;

dev->cmd->status = status;

if (status != 0) {
dev_dbg(dev->dev, "%s: Error received: %d\n", __func__, status);
goto sched_wq;
}

if (skb == NULL) {
pr_err("NULL Frame -> link is dead\n");
goto sched_wq;
Expand Down

0 comments on commit b31d510

Please sign in to comment.