]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
IB/mthca: Fix use-after-free on device restart
authorAli Ayoub <ali@mellanox.co.il>
Thu, 17 May 2007 17:58:30 +0000 (20:58 +0300)
committerRoland Dreier <rolandd@cisco.com>
Sat, 19 May 2007 15:51:56 +0000 (08:51 -0700)
Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_main.c

index 773145e299478eea39b5367b56d3ac8e3d9fece7..aa563e61de65cb3fb02f0129290b448dfb529936 100644 (file)
@@ -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,