Commit e101e7dd authored by Shreyas Bhatewara's avatar Shreyas Bhatewara Committed by David S. Miller

vmxnet3: set netdev parant device before calling netdev_info

Parent device for netdev should be set before netdev_info() can be called
otherwise there is a NULL pointer dereference and probe() fails.
Signed-off-by: default avatarShreyas N Bhatewara <sbhatewara@vmware.com>
Signed-off-by: Scott J. Goldman <scottjg@vmware.com>--
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30885909
...@@ -2993,6 +2993,7 @@ vmxnet3_probe_device(struct pci_dev *pdev, ...@@ -2993,6 +2993,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
goto err_ver; goto err_ver;
} }
SET_NETDEV_DEV(netdev, &pdev->dev);
vmxnet3_declare_features(adapter, dma64); vmxnet3_declare_features(adapter, dma64);
adapter->dev_number = atomic_read(&devices_found); adapter->dev_number = atomic_read(&devices_found);
...@@ -3038,7 +3039,6 @@ vmxnet3_probe_device(struct pci_dev *pdev, ...@@ -3038,7 +3039,6 @@ vmxnet3_probe_device(struct pci_dev *pdev,
netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues); netif_set_real_num_rx_queues(adapter->netdev, adapter->num_rx_queues);
SET_NETDEV_DEV(netdev, &pdev->dev);
err = register_netdev(netdev); err = register_netdev(netdev);
if (err) { if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment