summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
diff options
context:
space:
mode:
authorDipendra Khadka <kdipendra88@gmail.com>2024-10-17 18:56:33 +0000
committerAndrew Lunn <andrew@lunn.ch>2024-10-22 17:35:35 -0500
commit0fbc7a5027c6f7f2c785adae3dcec22b2f2b69b3 (patch)
treee385116bf98a7d6d9005bb1bf0b3092f8fb11d31 /drivers/net/ethernet/marvell
parentd811ac148f0afd2f3f7e1cd7f54de8da973ec5e3 (diff)
downloadlinux-0fbc7a5027c6f7f2c785adae3dcec22b2f2b69b3.tar.gz
linux-0fbc7a5027c6f7f2c785adae3dcec22b2f2b69b3.tar.bz2
linux-0fbc7a5027c6f7f2c785adae3dcec22b2f2b69b3.zip
octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_common.c
Add error pointer check after calling otx2_mbox_get_rsp(). Fixes: ab58a416c93f ("octeontx2-pf: cn10k: Get max mtu supported from admin function") Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r--drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
index 87d5776e3b88..7510a918d942 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
@@ -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