octeontx2-pf: cn10k: Fix error return code in otx2_set_flowkey_cfg()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 25 Aug 2021 06:34:47 +0000 (14:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Aug 2021 09:44:50 +0000 (10:44 +0100)
If otx2_mbox_get_rsp() fails, otx2_set_flowkey_cfg() need return an
error code.

Fixes: e7938365459f ("octeontx2-pf: Fix algorithm index in MCAM rules with RSS action")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

index e026827..67dced6 100644 (file)
@@ -289,8 +289,10 @@ int otx2_set_flowkey_cfg(struct otx2_nic *pfvf)
 
        rsp = (struct nix_rss_flowkey_cfg_rsp *)
                        otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
-       if (IS_ERR(rsp))
+       if (IS_ERR(rsp)) {
+               err = PTR_ERR(rsp);
                goto fail;
+       }
 
        pfvf->hw.flowkey_alg_idx = rsp->alg_idx;
 fail: