summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSu Hui <suhui@nfschina.com>2023-10-20 12:27:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-08 13:22:21 +0300
commit0249cead197d5800aa3135e73cb1124d9ccfd8a8 (patch)
treedbad217879c1afc8bdce49452d072a82f88aaa83
parentb5d3ebdeead8ba420678e55ddb046741e0a0d6e3 (diff)
downloadlinux-0249cead197d5800aa3135e73cb1124d9ccfd8a8.tar.xz
net: chelsio: cxgb4: add an error code check in t4_load_phy_fw
[ Upstream commit 9f771493da935299c6393ad3563b581255d01a37 ] t4_set_params_timeout() can return -EINVAL if failed, add check for this. Signed-off-by: Su Hui <suhui@nfschina.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_hw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 812f4b743d97..0e8aa2d803eb 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -3850,6 +3850,8 @@ int t4_load_phy_fw(struct adapter *adap,
FW_PARAMS_PARAM_Z_V(FW_PARAMS_PARAM_DEV_PHYFW_DOWNLOAD));
ret = t4_set_params_timeout(adap, adap->mbox, adap->pf, 0, 1,
&param, &val, 30000);
+ if (ret)
+ return ret;
/* If we have version number support, then check to see that the new
* firmware got loaded properly.