Commit 4674d0fe authored by Wei Yongjun's avatar Wei Yongjun Committed by Samuel Ortiz

NFC: pn533: Fix error return code in pn533_probe()

Fix to return -ENOMEM in the nfc device alloc error handling
case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent a69bdc1e
...@@ -2783,8 +2783,10 @@ static int pn533_probe(struct usb_interface *interface, ...@@ -2783,8 +2783,10 @@ static int pn533_probe(struct usb_interface *interface,
dev->ops->tx_header_len + dev->ops->tx_header_len +
PN533_CMD_DATAEXCH_HEAD_LEN, PN533_CMD_DATAEXCH_HEAD_LEN,
dev->ops->tx_tail_len); dev->ops->tx_tail_len);
if (!dev->nfc_dev) if (!dev->nfc_dev) {
rc = -ENOMEM;
goto destroy_wq; goto destroy_wq;
}
nfc_set_parent_dev(dev->nfc_dev, &interface->dev); nfc_set_parent_dev(dev->nfc_dev, &interface->dev);
nfc_set_drvdata(dev->nfc_dev, dev); nfc_set_drvdata(dev->nfc_dev, dev);
......
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