Skip to contentSkip to conversation

ibmvnic: Correct return code checking for ibmvnic_init during probe

PATCH Applied Nathan Fontenot 2 participants 2 messages Jun 21, 2017 – Jun 22, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ibmvnic: Correct return code checking for ibmvnic_init during probe

The update to ibmvnic_init to allow an EAGAIN return code broke the calling of ibmvnic_init from ibmvnic_probe. The code now will return from this point in the probe routine if anything other than EAGAIN is returned. The check should be to see if rc is non-zero and not equal to EAGAIN.

Without this fix, the vNIC driver can return 0 (success) from its probe routine due to ibmvnic_init returning zero, but before completing the probe process and registering with the netdev layer.

Fixes 6a2fb0e99f9c (ibmvnic: driver initialization for kdump/kexec)
---
 drivers/net/ethernet/ibm/ibmvnic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +1 -1
index 0135095..05edf19 100644
@@ -3737,7 +3737,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
 
 	do {
 		rc = ibmvnic_init(adapter);
-		if (rc != EAGAIN) {
+		if (rc && rc != EAGAIN) {
 			free_netdev(netdev);
 			return rc;
 		}
maintainer Applied
#1 lore raw

From: Nathan Fontenot <[email protected]>
Date: Wed, 21 Jun 2017 15:41:02 -0500

Quoted 6 lines

The update to ibmvnic_init to allow an EAGAIN return code broke the calling of ibmvnic_init from ibmvnic_probe. The code now will return from this point in the probe routine if anything other than EAGAIN is returned. The check should be to see if rc is non-zero and not equal to EAGAIN.

Quoted 6 lines

Without this fix, the vNIC driver can return 0 (success) from its probe routine due to ibmvnic_init returning zero, but before completing the probe process and registering with the netdev layer.

Fixes 6a2fb0e99f9c (ibmvnic: driver initialization for kdump/kexec)

Applied.