Skip to content

Commit 8a76547

Browse files
Dan Carpenterdavem330
authored andcommitted
octeontx2-pf: unlock on error path in otx2_config_pause_frm()
We need to unlock before returning if this allocation fails. Fixes: 75f3627 ("octeontx2-pf: Support to enable/disable pause frames via ethtool") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0f70eed commit 8a76547

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,17 @@ int otx2_config_pause_frm(struct otx2_nic *pfvf)
227227

228228
otx2_mbox_lock(&pfvf->mbox);
229229
req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
230-
if (!req)
231-
return -ENOMEM;
230+
if (!req) {
231+
err = -ENOMEM;
232+
goto unlock;
233+
}
232234

233235
req->rx_pause = !!(pfvf->flags & OTX2_FLAG_RX_PAUSE_ENABLED);
234236
req->tx_pause = !!(pfvf->flags & OTX2_FLAG_TX_PAUSE_ENABLED);
235237
req->set = 1;
236238

237239
err = otx2_sync_mbox_msg(&pfvf->mbox);
240+
unlock:
238241
otx2_mbox_unlock(&pfvf->mbox);
239242
return err;
240243
}

0 commit comments

Comments
 (0)