]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix use-after-free in libata
authorJeff Garzik <jgarzik@pobox.com>
Fri, 5 Dec 2003 15:32:14 +0000 (07:32 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 5 Dec 2003 15:32:14 +0000 (07:32 -0800)
Fixes oops some were seeing on module unload.

Caught by Jon Burgess.

drivers/scsi/libata-core.c

index b92d67726018fd96d571e976127df0dcfadde680..82ab1607275c8d91ed164c6d205177e33ca7f5a9 100644 (file)
@@ -3224,8 +3224,6 @@ void ata_pci_remove_one (struct pci_dev *pdev)
                scsi_host_put(ap->host); /* FIXME: check return val */
        }
 
-       kfree(host_set);
-
        pci_release_regions(pdev);
 
        for (i = 0; i < host_set->n_ports; i++) {
@@ -3242,6 +3240,7 @@ void ata_pci_remove_one (struct pci_dev *pdev)
                }
        }
 
+       kfree(host_set);
        pci_disable_device(pdev);
        pci_set_drvdata(pdev, NULL);
 }