Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad008d42bcec99911b3270a8349f8ec8405a1c4e
Commit:     ad008d42bcec99911b3270a8349f8ec8405a1c4e
Parent:     3b0f208a583f130f1e551a6b8673734f51ab7dcd
Author:     Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 19 20:03:57 2008 -0600
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Feb 22 09:08:13 2008 -0600

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 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 bfda731..0c303c8 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)
 
        ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
        if (pci_enable_device_mem(pdev)) {
-               kfree(ioc);
                printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() "
                       "failed\n", ioc->name);
+               kfree(ioc);
                return r;
        }
        if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) {
-               kfree(ioc);
                printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with "
                       "MEM failed\n", ioc->name);
+               kfree(ioc);
                return r;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to