Commit ad008d42 authored by Adrian Bunk's avatar Adrian Bunk Committed by James Bottomley
Browse files

[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 e78d5b8f

 and spotted by the
Coverity checker.
Signed-off-by: default avatarAdrian Bunk <>
Signed-off-by: default avatarJames Bottomley <>
parent 3b0f208a
......@@ -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)) {
printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() "
"failed\n", ioc->name);
return r;
if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) {
printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with "
"MEM failed\n", ioc->name);
return r;
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