Explorar o código

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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Wei Yongjun %!s(int64=12) %!d(string=hai) anos
pai
achega
4674d0fecb
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      drivers/nfc/pn533.c

+ 3 - 1
drivers/nfc/pn533.c

@@ -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);