diff options
Diffstat (limited to 'drivers/nfc/pn533.c')
-rw-r--r-- | drivers/nfc/pn533.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index d123444404c8..97c440a8cd61 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c | |||
@@ -716,7 +716,7 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev, | |||
716 | void *arg, gfp_t flags) | 716 | void *arg, gfp_t flags) |
717 | { | 717 | { |
718 | struct pn533_cmd *cmd; | 718 | struct pn533_cmd *cmd; |
719 | int rc; | 719 | int rc = 0; |
720 | 720 | ||
721 | nfc_dev_dbg(&dev->interface->dev, "%s", __func__); | 721 | nfc_dev_dbg(&dev->interface->dev, "%s", __func__); |
722 | 722 | ||
@@ -729,16 +729,16 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev, | |||
729 | if (!rc) | 729 | if (!rc) |
730 | dev->cmd_pending = 1; | 730 | dev->cmd_pending = 1; |
731 | 731 | ||
732 | mutex_unlock(&dev->cmd_lock); | 732 | goto unlock; |
733 | |||
734 | return rc; | ||
735 | } | 733 | } |
736 | 734 | ||
737 | nfc_dev_dbg(&dev->interface->dev, "%s Queueing command", __func__); | 735 | nfc_dev_dbg(&dev->interface->dev, "%s Queueing command", __func__); |
738 | 736 | ||
739 | cmd = kzalloc(sizeof(struct pn533_cmd), flags); | 737 | cmd = kzalloc(sizeof(struct pn533_cmd), flags); |
740 | if (!cmd) | 738 | if (!cmd) { |
741 | return -ENOMEM; | 739 | rc = -ENOMEM; |
740 | goto unlock; | ||
741 | } | ||
742 | 742 | ||
743 | INIT_LIST_HEAD(&cmd->queue); | 743 | INIT_LIST_HEAD(&cmd->queue); |
744 | cmd->out_frame = out_frame; | 744 | cmd->out_frame = out_frame; |
@@ -750,9 +750,10 @@ static int pn533_send_cmd_frame_async(struct pn533 *dev, | |||
750 | 750 | ||
751 | list_add_tail(&cmd->queue, &dev->cmd_queue); | 751 | list_add_tail(&cmd->queue, &dev->cmd_queue); |
752 | 752 | ||
753 | unlock: | ||
753 | mutex_unlock(&dev->cmd_lock); | 754 | mutex_unlock(&dev->cmd_lock); |
754 | 755 | ||
755 | return 0; | 756 | return rc; |
756 | } | 757 | } |
757 | 758 | ||
758 | struct pn533_sync_cmd_response { | 759 | struct pn533_sync_cmd_response { |