]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
cxgb4: copy mbox log size to PF0-3 adap instances
authorGanesh Goudar <ganeshgr@chelsio.com>
Wed, 9 May 2018 13:30:35 +0000 (19:00 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 May 2018 20:02:07 +0000 (16:02 -0400)
copy mbox size to adapter instances of PF0-3 to avoid
mbox log overflow. This fixes the possible protection
fault.

Fixes: baf5086840ab ("cxgb4: restructure VF mgmt code")
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

index c3ae5750d414d297803872f8cc49cc94547b90e4..005283c7cdfe75a75d5e88048d4e6ea241bdfbb9 100644 (file)
@@ -5474,6 +5474,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        spin_lock_init(&adapter->mbox_lock);
        INIT_LIST_HEAD(&adapter->mlist.list);
+       adapter->mbox_log->size = T4_OS_LOG_MBOX_CMDS;
        pci_set_drvdata(pdev, adapter);
 
        if (func != ent->driver_data) {
@@ -5508,8 +5509,6 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto out_free_adapter;
        }
 
-       adapter->mbox_log->size = T4_OS_LOG_MBOX_CMDS;
-
        /* PCI device has been enabled */
        adapter->flags |= DEV_ENABLED;
        memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map));