]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: chelsio: cxgb4: add an error code check in t4_load_phy_fw
authorSu Hui <suhui@nfschina.com>
Fri, 20 Oct 2023 09:27:59 +0000 (17:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 10:21:09 +0000 (11:21 +0100)
[ 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>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index ecb8ef4a756fcc6274af54deb024de8218e3ad17..6ffd5f3dcf059419d1f5ac60d78cc541e30e3c5d 100644 (file)
@@ -3710,6 +3710,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.