Move mutex initialization by allocation of the mailbox it protects.
introduced in commit
1d6f3cd89 'bnx2x: Prevent VF race'
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
*/
if (IS_VF(bp)) {
bp->doorbells = bnx2x_vf_doorbells(bp);
- mutex_init(&bp->vf2pf_mutex);
rc = bnx2x_vf_pci_alloc(bp);
if (rc)
goto init_one_exit;
int bnx2x_vf_pci_alloc(struct bnx2x *bp)
{
+ mutex_init(&bp->vf2pf_mutex);
+
/* allocate vf2pf mailbox for vf to pf channel */
BNX2X_PCI_ALLOC(bp->vf2pf_mbox, &bp->vf2pf_mbox_mapping,
sizeof(struct bnx2x_vf_mbx_msg));