浏览代码

ibmvnic: Handle error case when setting link state

If setting the link state is not successful, print a warning
with the resulting return code and return it to be handled
by the caller.

Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Thomas Falcon 7 年之前
父节点
当前提交
ab5ec33b9a
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/net/ethernet/ibm/ibmvnic.c

+ 4 - 0
drivers/net/ethernet/ibm/ibmvnic.c

@@ -929,6 +929,10 @@ static int set_link_state(struct ibmvnic_adapter *adapter, u8 link_state)
 			/* Partuial success, delay and re-send */
 			/* Partuial success, delay and re-send */
 			mdelay(1000);
 			mdelay(1000);
 			resend = true;
 			resend = true;
+		} else if (adapter->init_done_rc) {
+			netdev_warn(netdev, "Unable to set link state, rc=%d\n",
+				    adapter->init_done_rc);
+			return adapter->init_done_rc;
 		}
 		}
 	} while (resend);
 	} while (resend);