diff options
author | Ali Ayoub <ali@mellanox.co.il> | 2007-05-17 19:58:30 +0200 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-05-19 17:51:56 +0200 |
commit | de57c9f102ad7bdc8afa5a1560748cf4f1c18b8e (patch) | |
tree | dccb61b8458206bac0a1c19ce0d9124ff8abd90f /drivers/infiniband/hw/mthca | |
parent | IB/ehca: Return proper error code if register_mr fails (diff) | |
download | linux-de57c9f102ad7bdc8afa5a1560748cf4f1c18b8e.tar.xz linux-de57c9f102ad7bdc8afa5a1560748cf4f1c18b8e.zip |
IB/mthca: Fix use-after-free on device restart
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index 773145e29947..aa563e61de65 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c @@ -1250,12 +1250,14 @@ static void __mthca_remove_one(struct pci_dev *pdev) int __mthca_restart_one(struct pci_dev *pdev) { struct mthca_dev *mdev; + int hca_type; mdev = pci_get_drvdata(pdev); if (!mdev) return -ENODEV; + hca_type = mdev->hca_type; __mthca_remove_one(pdev); - return __mthca_init_one(pdev, mdev->hca_type); + return __mthca_init_one(pdev, hca_type); } static int __devinit mthca_init_one(struct pci_dev *pdev, |