Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c

Adding error pointer check after calling otx2_mbox_get_rsp().

Fixes: 9917060fc30a ("octeontx2-pf: Cleanup flow rule management")
Fixes: f0a1913f8a6f ("octeontx2-pf: Add support for ethtool ntuple filters")
Fixes: 674b3e164238 ("octeontx2-pf: Add additional checks while configuring ucast/bcast/mcast rules")
Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>

authored by

Dipendra Khadka and committed by
Andrew Lunn
bd3110bc e26f8eac

+10
+10
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c
··· 119 119 120 120 rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp 121 121 (&pfvf->mbox.mbox, 0, &req->hdr); 122 + if (IS_ERR(rsp)) 123 + goto exit; 122 124 123 125 for (ent = 0; ent < rsp->count; ent++) 124 126 flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent]; ··· 199 197 200 198 rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp 201 199 (&pfvf->mbox.mbox, 0, &req->hdr); 200 + if (IS_ERR(rsp)) { 201 + mutex_unlock(&pfvf->mbox.lock); 202 + return PTR_ERR(rsp); 203 + } 202 204 203 205 if (rsp->count != req->count) { 204 206 netdev_info(pfvf->netdev, ··· 238 232 239 233 frsp = (struct npc_get_field_status_rsp *)otx2_mbox_get_rsp 240 234 (&pfvf->mbox.mbox, 0, &freq->hdr); 235 + if (IS_ERR(frsp)) { 236 + mutex_unlock(&pfvf->mbox.lock); 237 + return PTR_ERR(frsp); 238 + } 241 239 242 240 if (frsp->enable) { 243 241 pfvf->flags |= OTX2_FLAG_RX_VLAN_SUPPORT;