Skip to content

Commit 9572c94

Browse files
Subbaraya Sundeepdavem330
Subbaraya Sundeep
authored andcommitted
octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam
All the mailbox messages sent to AF needs to be guarded by mutex lock. Add the missing lock in otx2_get_pauseparam function. Fixes: 75f3627 ("octeontx2-pf: Support to enable/disable pause frames via ethtool") Signed-off-by: Subbaraya Sundeep <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cf50b5c commit 9572c94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,16 +334,20 @@ static void otx2_get_pauseparam(struct net_device *netdev,
334334
if (is_otx2_lbkvf(pfvf->pdev))
335335
return;
336336

337+
mutex_lock(&pfvf->mbox.lock);
337338
req = otx2_mbox_alloc_msg_cgx_cfg_pause_frm(&pfvf->mbox);
338-
if (!req)
339+
if (!req) {
340+
mutex_unlock(&pfvf->mbox.lock);
339341
return;
342+
}
340343

341344
if (!otx2_sync_mbox_msg(&pfvf->mbox)) {
342345
rsp = (struct cgx_pause_frm_cfg *)
343346
otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
344347
pause->rx_pause = rsp->rx_pause;
345348
pause->tx_pause = rsp->tx_pause;
346349
}
350+
mutex_unlock(&pfvf->mbox.lock);
347351
}
348352

349353
static int otx2_set_pauseparam(struct net_device *netdev,

0 commit comments

Comments
 (0)