Skip to content

Commit f5b942e

Browse files
Dipendra333lunn
authored andcommitted
octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c
Add error pointer checks after calling otx2_mbox_get_rsp(). Fixes: 79d2be3 ("octeontx2-pf: offload DMAC filters to CGX/RPM block") Fixes: fa5e0cc ("octeontx2-pf: Add support for exact match table.") Signed-off-by: Dipendra Khadka <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Andrew Lunn <[email protected]>
1 parent ac91830 commit f5b942e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ static int otx2_dmacflt_do_add(struct otx2_nic *pf, const u8 *mac,
2828
if (!err) {
2929
rsp = (struct cgx_mac_addr_add_rsp *)
3030
otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr);
31+
if (IS_ERR(rsp)) {
32+
mutex_unlock(&pf->mbox.lock);
33+
return PTR_ERR(rsp);
34+
}
35+
3136
*dmac_index = rsp->index;
3237
}
3338

@@ -200,6 +205,10 @@ int otx2_dmacflt_update(struct otx2_nic *pf, u8 *mac, u32 bit_pos)
200205

201206
rsp = (struct cgx_mac_addr_update_rsp *)
202207
otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr);
208+
if (IS_ERR(rsp)) {
209+
rc = PTR_ERR(rsp);
210+
goto out;
211+
}
203212

204213
pf->flow_cfg->bmap_to_dmacindex[bit_pos] = rsp->index;
205214

0 commit comments

Comments
 (0)