Commit 0fbf3d40 authored by Mark Rustad's avatar Mark Rustad Committed by Luis Henriques

ixgbe: Fix possible null-dereference in error path

commit 508a8c9e upstream.

In ixgbe_probe, the code at label err_dma can dereference adapter
when it has a NULL value. The check is there to avoid disabling a
disabled device. When adapter is NULL, treat it as if the device
is enabled, because it is enabled in that case.
Signed-off-by: default avatarMark Rustad <mark.d.rustad@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent c1673386
......@@ -8477,7 +8477,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_select_bars(pdev, IORESOURCE_MEM));
err_pci_reg:
err_dma:
if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
if (!adapter || !test_and_set_bit(__IXGBE_DISABLED, &adapter->state))
pci_disable_device(pdev);
return 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