Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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)
Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nathan Fontenot and committed by
David S. Miller
6d659237 9995bac5

+1 -1
+1 -1
drivers/net/ethernet/ibm/ibmvnic.c
··· 3726 3726 3727 3727 do { 3728 3728 rc = ibmvnic_init(adapter); 3729 - if (rc != EAGAIN) { 3729 + if (rc && rc != EAGAIN) { 3730 3730 free_netdev(netdev); 3731 3731 return rc; 3732 3732 }