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_ethtool.c

Add error pointer check after calling otx2_mbox_get_rsp().

Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool")
Fixes: d0cf9503e908 ("octeontx2-pf: ethtool fec mode support")
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
e26f8eac 0fbc7a50

+10
+10
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
··· 343 343 if (!otx2_sync_mbox_msg(&pfvf->mbox)) { 344 344 rsp = (struct cgx_pause_frm_cfg *) 345 345 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); 346 + if (IS_ERR(rsp)) { 347 + mutex_unlock(&pfvf->mbox.lock); 348 + return; 349 + } 350 + 346 351 pause->rx_pause = rsp->rx_pause; 347 352 pause->tx_pause = rsp->tx_pause; 348 353 } ··· 1077 1072 1078 1073 rsp = (struct fec_mode *)otx2_mbox_get_rsp(&pfvf->mbox.mbox, 1079 1074 0, &req->hdr); 1075 + if (IS_ERR(rsp)) { 1076 + err = PTR_ERR(rsp); 1077 + goto end; 1078 + } 1079 + 1080 1080 if (rsp->fec >= 0) 1081 1081 pfvf->linfo.fec = rsp->fec; 1082 1082 else