Skip to content

Commit 3d2cbbc

Browse files
tlendackygregkh
authored andcommitted
amd-xgbe: Check xgbe_init() return code
[ Upstream commit 738f7f647371ff4cfc9646c99dba5b58ad142db3 ] 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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent dac30e3 commit 3d2cbbc

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/net/ethernet/amd/xgbe/xgbe-dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2732,8 +2732,10 @@ static int xgbe_init(struct xgbe_prv_data *pdata)
27322732

27332733
/* Flush Tx queues */
27342734
ret = xgbe_flush_tx_queues(pdata);
2735-
if (ret)
2735+
if (ret) {
2736+
netdev_err(pdata->netdev, "error flushing TX queues\n");
27362737
return ret;
2738+
}
27372739

27382740
/*
27392741
* Initialize DMA related features

drivers/net/ethernet/amd/xgbe/xgbe-drv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,9 @@ static int xgbe_start(struct xgbe_prv_data *pdata)
877877

878878
DBGPR("-->xgbe_start\n");
879879

880-
hw_if->init(pdata);
880+
ret = hw_if->init(pdata);
881+
if (ret)
882+
return ret;
881883

882884
ret = phy_if->phy_start(pdata);
883885
if (ret)

0 commit comments

Comments
 (0)