NFC: pn533: Fix error return code in pn533_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 7 May 2013 12:07:52 +0000 (20:07 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 13 Jun 2013 22:18:58 +0000 (00:18 +0200)
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>
drivers/nfc/pn533.c

index 8f6f2baa930d7efea25f733f44f115dd4495b3b8..0bdfa8852e78b6ef29cc4261302bb3d47c0ac3cd 100644 (file)
@@ -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);