Commit dbdb6f6f authored by Jeff Garzik's avatar Jeff Garzik

[libata] fix use-after-free

Fixes oops some were seeing on module unload.

Caught by Jon Burgess.
parent 5fac4115
...@@ -3224,8 +3224,6 @@ void ata_pci_remove_one (struct pci_dev *pdev) ...@@ -3224,8 +3224,6 @@ void ata_pci_remove_one (struct pci_dev *pdev)
scsi_host_put(ap->host); /* FIXME: check return val */ scsi_host_put(ap->host); /* FIXME: check return val */
} }
kfree(host_set);
pci_release_regions(pdev); pci_release_regions(pdev);
for (i = 0; i < host_set->n_ports; i++) { for (i = 0; i < host_set->n_ports; i++) {
...@@ -3242,6 +3240,7 @@ void ata_pci_remove_one (struct pci_dev *pdev) ...@@ -3242,6 +3240,7 @@ void ata_pci_remove_one (struct pci_dev *pdev)
} }
} }
kfree(host_set);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment