Skip to content

Commit 69297b0

Browse files
Dipendra333lunn
authored andcommitted
octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dcbnl.c
Add error pointer check after calling otx2_mbox_get_rsp(). Fixes: 8e67558 ("octeontx2-pf: PFC config support with DCBx") Signed-off-by: Dipendra Khadka <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Andrew Lunn <[email protected]>
1 parent f5b942e commit 69297b0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ int otx2_config_priority_flow_ctrl(struct otx2_nic *pfvf)
315315
if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
316316
rsp = (struct cgx_pfc_rsp *)
317317
otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
318+
if (IS_ERR(rsp)) {
319+
err = PTR_ERR(rsp);
320+
goto unlock;
321+
}
322+
318323
if (req->rx_pause != rsp->rx_pause || req->tx_pause != rsp->tx_pause) {
319324
dev_warn(pfvf->dev,
320325
"Failed to config PFC\n");

0 commit comments

Comments
 (0)