Commit 423e4378 authored by Dipendra Khadka's avatar Dipendra Khadka Committed by Zeng Heng
Browse files

octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c

stable inclusion
from stable-v6.6.64
commit 52c63a6a27d3178fab533fcfb4baa2ed5b8608a3
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBEDOQ
CVE: CVE-2024-56679

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=52c63a6a27d3178fab533fcfb4baa2ed5b8608a3



--------------------------------

[ Upstream commit 0fbc7a5027c6f7f2c785adae3dcec22b2f2b69b3 ]

Add error pointer check after calling otx2_mbox_get_rsp().

Fixes: ab58a416 ("octeontx2-pf: cn10k: Get max mtu supported from admin function")
Signed-off-by: default avatarDipendra Khadka <kdipendra88@gmail.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
parent fc1d9b69
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1837,6 +1837,10 @@ u16 otx2_get_max_mtu(struct otx2_nic *pfvf)
	if (!rc) {
		rsp = (struct nix_hw_info *)
		       otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
		if (IS_ERR(rsp)) {
			rc = PTR_ERR(rsp);
			goto out;
		}

		/* HW counts VLAN insertion bytes (8 for double tag)
		 * irrespective of whether SQE is requesting to insert VLAN