net: ethernet: marvell: octeontx2: nic: Add error pointer check in otx2_common.c
PATCH v2 1/1 net: ethernet: marvell: octeontx2: nic: Add error pointer check in otx2_common.c
Adding error pointer check after calling otx2_mbox_get_rsp().
---
v2:
- Added Fixes: tag.
- Changed the return logic to follow the existing return path.
v1: https://lore.kernel.org/all/[email protected]/
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +4 -0
@@ -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
Signature · 1 line
2.43.0
Simon Horman
reviewer+ Maxime Chevallier
Quoted 11 lines · Dipendra Khadka
Adding 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 <[email protected]>---
v2:
- Added Fixes: tag.
- Changed the return logic to follow the existing return path.
v1: https://lore.kernel.org/all/[email protected]/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 4 ++++ 1 file changed, 4 insertions(+)
Hi Dipendra,
Thanks for the updates,
I agree that this addresses Maxime's changes. I've CCed him here, please consider CCing people who comment on earlier revisions of patches.
My only nit about this patch is that, as per mo comment on [1], I think the prefix in the subject should be 'octeontx2-pf: '.
[1] https://lore.kernel.org/netdev/[email protected]/
Quoted 16 lines
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +4
-0@@ -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
Signature · 1 line
pw-bot: changes-requested