[PATCH 3.16.y-ckt 099/168] ixgbe: Fix possible null-dereference in error path
From: Luis Henriques
Date: Mon Dec 15 2014 - 09:47:35 EST
3.16.7-ckt3 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rustad <mark.d.rustad@xxxxxxxxx>
commit 508a8c9e264e1057f663e578c47c5ffa00adb160 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: Mark Rustad <mark.d.rustad@xxxxxxxxx>
Tested-by: Phil Schmitt <phillip.j.schmitt@xxxxxxxxx>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>
Signed-off-by: Luis Henriques <luis.henriques@xxxxxxxxxxxxx>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 889005922c33..c4d560d7dabb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8477,7 +8477,7 @@ err_alloc_etherdev:
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;
}
--
2.1.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/