diff options
author | Adrian Bunk <bunk@kernel.org> | 2008-02-19 21:03:57 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-02-22 10:08:13 -0500 |
commit | ad008d42bcec99911b3270a8349f8ec8405a1c4e (patch) | |
tree | b6dc4fce8cc602ebb17ddc18dd228952461af00d /drivers/message/fusion | |
parent | 3b0f208a583f130f1e551a6b8673734f51ab7dcd (diff) |
[SCSI] mptbase: fix use-after-free's
ioc->name is used in the printk's after ioc has been freed. Free
after prinks to fix this.
This patch fixes two use-after-free's introduced by
commit e78d5b8f1e73ab82f3fd041d05824cfee7d83a2c and spotted by the
Coverity checker.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index bfda731696f7..0c303c84b37b 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1481,15 +1481,15 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1481 | 1481 | ||
1482 | ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM); | 1482 | ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM); |
1483 | if (pci_enable_device_mem(pdev)) { | 1483 | if (pci_enable_device_mem(pdev)) { |
1484 | kfree(ioc); | ||
1485 | printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() " | 1484 | printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() " |
1486 | "failed\n", ioc->name); | 1485 | "failed\n", ioc->name); |
1486 | kfree(ioc); | ||
1487 | return r; | 1487 | return r; |
1488 | } | 1488 | } |
1489 | if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) { | 1489 | if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) { |
1490 | kfree(ioc); | ||
1491 | printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with " | 1490 | printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with " |
1492 | "MEM failed\n", ioc->name); | 1491 | "MEM failed\n", ioc->name); |
1492 | kfree(ioc); | ||
1493 | return r; | 1493 | return r; |
1494 | } | 1494 | } |
1495 | 1495 | ||