From: Nathan Fontenot Date: Fri, 21 Apr 2017 19:39:10 +0000 (-0400) Subject: ibmvnic: Validate napi exist before disabling them X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ca1993264503957f81f3846598b16601b1e9457;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ibmvnic: Validate napi exist before disabling them Validate that the napi structs exist before trying to disable them at driver close. Signed-off-by: Nathan Fontenot Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 115f21694994..5a916a2f91be 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -729,8 +729,10 @@ static int ibmvnic_close(struct net_device *netdev) adapter->closing = true; disable_sub_crqs(adapter); - for (i = 0; i < adapter->req_rx_queues; i++) - napi_disable(&adapter->napi[i]); + if (adapter->napi) { + for (i = 0; i < adapter->req_rx_queues; i++) + napi_disable(&adapter->napi[i]); + } if (!adapter->failover) netif_tx_stop_all_queues(netdev);