octeontx2-pf: handle otx2_mbox_get_rsp errors
PATCH 1/1 octeontx2-pf: handle otx2_mbox_get_rsp errors
Adding error pointer check after calling otx2_mbox_get_rsp().
This is similar to the commit bd3110bc102a ("octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c").
--- drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/rep.c +2 -0
@@ -67,6 +67,8 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep) rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp (&priv->mbox.mbox,0 , &req->hdr); +if (IS_ERR (rsp)) + goto exit;for (ent =0 ; ent < rsp->count; ent++) rep->flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];
Signature · 1 line
2.34.1
Quoted 16 lines · Chenyuan Yang
Adding error pointer check after calling
otx2_mbox_get_rsp().This is similar to the commit
bd3110bc102a("octeontx2-pf: handleotx2_mbox_get_rsperrors inotx2_flows.c").Signed-off-by Chenyuan Yang <[email protected]>Fixes 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")--- drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/ethernet/marvell/octeontx2/nic/rep.c +0
-0
drivers/net/ethernet/marvell/octeontx2/nic/rep.c static int rvu_rep_mcam_flow_init(struct rep_dev *rep) · line 71
Quoted 5 lines
drivers/net/ethernet/marvell/octeontx2/nic/rep.c +2
-0@@ -67,6 +67,8 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep) rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp (&priv->mbox.mbox,0 , &req->hdr); +if (IS_ERR (rsp)) + goto exit;
Changes looks fine:
BTW, looks like now you can use break instead of goto exit, as exit label is just after the while loop.
Quoted 5 lines
drivers/net/ethernet/marvell/octeontx2/nic/rep.c +0
-0for (ent =0 ; ent < rsp->count; ent++) rep->flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];Signature · 1 line
2.34.1
Simon Horman
reviewerQuoted 24 lines · Michal Swiatkowski
Quoted 16 lines · Chenyuan Yang
Adding error pointer check after calling
otx2_mbox_get_rsp().This is similar to the commit
bd3110bc102a("octeontx2-pf: handleotx2_mbox_get_rsperrors inotx2_flows.c").Signed-off-by Chenyuan Yang <[email protected]>Fixes 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")--- drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/ethernet/marvell/octeontx2/nic/rep.c +0
-0drivers/net/ethernet/marvell/octeontx2/nic/rep.c static int rvu_rep_mcam_flow_init(struct rep_dev *rep) · line 71
Quoted 5 lines
drivers/net/ethernet/marvell/octeontx2/nic/rep.c +2
-0@@ -67,6 +67,8 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep) rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp (&priv->mbox.mbox,0 , &req->hdr); +if (IS_ERR (rsp)) + goto exit;Changes looks fine:
Quoted 4 lines
Reviewed-by Michal Swiatkowski <[email protected]>BTW, looks like now you can use break instead of goto exit, as exit label is just after the while loop.
True. My suggestion would be to keep this patch as-is. And, once it has hit net-next, send a follow-up to remove the exit label.
Quoted 7 lines
Quoted 6 lines
drivers/net/ethernet/marvell/octeontx2/nic/rep.c +0
-0for (ent =0 ; ent < rsp->count; ent++) rep->flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];Signature · 1 line
2.34.1
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Sat, 12 Apr 2025 13:33:27 -0500 you wrote:
Adding error pointer check after calling
otx2_mbox_get_rsp().This is similar to the commit
bd3110bc102a("octeontx2-pf: handleotx2_mbox_get_rsperrors inotx2_flows.c").Signed-off-by Chenyuan Yang <[email protected]>Fixes 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")[...]
Here is the summary with links:
- octeontx2-pf: handle otx2_mbox_get_rsp errors
https://git.kernel.org/netdev/net/c/688abe1027d0
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html