Skip to content

Commit

Permalink
ibmvnic: Correct return code checking for ibmvnic_init during probe
Browse files Browse the repository at this point in the history
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: 6a2fb0e (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>
  • Loading branch information
Nathan Fontenot authored and David S. Miller committed Jun 22, 2017
1 parent 9995bac commit 6d65923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/ibm/ibmvnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3726,7 +3726,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;
}
Expand Down

0 comments on commit 6d65923

Please sign in to comment.