[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1401619783-23659-1-git-send-email-ogerlitz@mellanox.com>
Date: Sun, 1 Jun 2014 13:49:43 +0300
From: Or Gerlitz <ogerlitz@...lanox.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, amirv@...lanox.com,
weiyang@...ux.vnet.ibm.com,
Jack Morgenstein <jackm@....mellanox.co.il>,
Or Gerlitz <ogerlitz@...lanox.com>
Subject: [PATCH net] net/mlx4_core: Fix Oops on reboot when SRIOV VFs are probed into the Host
From: Jack Morgenstein <jackm@....mellanox.co.il>
Commit befdf89 did not take into account the case where the Host
driver is being unloaded. In this case, pci_get_drvdata for the VF
remove_one call may return NULL, so that dereferencing the priv
struct results in a kernel oops.
The fix is to also test that the dev pointer returned by
pci_get_drvdata is non-NULL.
Fixes: befdf89 ("preserve pcd_dev_data after __mlx4_remove_one()")
Signed-off-by: Jack Morgenstein <jackm@....mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@...lanox.com>
---
drivers/net/ethernet/mellanox/mlx4/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index c187d74..a6ae089 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -2629,7 +2629,7 @@ static void __mlx4_remove_one(struct pci_dev *pdev)
int pci_dev_data;
int p;
- if (priv->removed)
+ if (!dev || priv->removed)
return;
pci_dev_data = priv->pci_dev_data;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists