Skip to content

Commit 8b49a4c

Browse files
Dmitry Kravkovdavem330
authored andcommitted
bnx2x: fix compilation without CONFIG_BNX2X_SRIOV
Move mutex initialization by allocation of the mailbox it protects. introduced in commit 1d6f3cd 'bnx2x: Prevent VF race' Signed-off-by: Dmitry Kravkov <[email protected]> Reported-by: kbuild test robot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f3d4039 commit 8b49a4c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12522,7 +12522,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
1252212522
*/
1252312523
if (IS_VF(bp)) {
1252412524
bp->doorbells = bnx2x_vf_doorbells(bp);
12525-
mutex_init(&bp->vf2pf_mutex);
1252612525
rc = bnx2x_vf_pci_alloc(bp);
1252712526
if (rc)
1252812527
goto init_one_exit;

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3425,6 +3425,8 @@ void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
34253425

34263426
int bnx2x_vf_pci_alloc(struct bnx2x *bp)
34273427
{
3428+
mutex_init(&bp->vf2pf_mutex);
3429+
34283430
/* allocate vf2pf mailbox for vf to pf channel */
34293431
BNX2X_PCI_ALLOC(bp->vf2pf_mbox, &bp->vf2pf_mbox_mapping,
34303432
sizeof(struct bnx2x_vf_mbx_msg));

0 commit comments

Comments
 (0)