Skip to content

Commit

Permalink
NFC: pn533: Fix error return code in pn533_probe()
Browse files Browse the repository at this point in the history
Fix to return -ENOMEM in the nfc device alloc error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Wei Yongjun authored and Samuel Ortiz committed Jun 13, 2013
1 parent a69bdc1 commit 4674d0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/nfc/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -2783,8 +2783,10 @@ static int pn533_probe(struct usb_interface *interface,
dev->ops->tx_header_len +
PN533_CMD_DATAEXCH_HEAD_LEN,
dev->ops->tx_tail_len);
if (!dev->nfc_dev)
if (!dev->nfc_dev) {
rc = -ENOMEM;
goto destroy_wq;
}

nfc_set_parent_dev(dev->nfc_dev, &interface->dev);
nfc_set_drvdata(dev->nfc_dev, dev);
Expand Down

0 comments on commit 4674d0f

Please sign in to comment.