]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
amd-xgbe: Check xgbe_init() return code
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Fri, 20 Jan 2017 18:14:13 +0000 (12:14 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 22 Jan 2017 21:57:14 +0000 (16:57 -0500)
The xgbe_init() routine returns a return code indicating success or
failure, but the return code is not checked. Add code to xgbe_init()
to issue a message when failures are seen and add code to check the
xgbe_init() return code.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-dev.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c

index c8e8a4a271ec961aa2212794b70d1e60265813a1..a7d16db5c4b21d8f9d80d9801259419da8def379 100644 (file)
@@ -3407,8 +3407,10 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
 
        /* Flush Tx queues */
        ret = xgbe_flush_tx_queues(pdata);
-       if (ret)
+       if (ret) {
+               netdev_err(pdata->netdev, "error flushing TX queues\n");
                return ret;
+       }
 
        /*
         * Initialize DMA related features
index 9943629fcbf9ae14a9683e0b2eb0da459f83c0c6..1c87cc20407590fc84710c9ecb4f8047cf811797 100644 (file)
@@ -1070,7 +1070,9 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
 
        DBGPR("-->xgbe_start\n");
 
-       hw_if->init(pdata);
+       ret = hw_if->init(pdata);
+       if (ret)
+               return ret;
 
        xgbe_napi_enable(pdata, 1);