diff options
author | Tomas Henzl <thenzl@redhat.com> | 2010-07-26 10:41:13 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:07:48 -0400 |
commit | 653c42d552d0fd0b05485442aed45dd2d62269c0 (patch) | |
tree | 14c99b23b544b4e111c7b1fd6d2804c94e2ae1d7 /drivers/message/fusion | |
parent | 943a2df8c8fb95a9d4243d4878db1c302ff85725 (diff) |
[SCSI] mptfusion: release resources in error return path
We should release the resources in error return code path.
The requested pci bars should be released under an error condition,
when mpt_mapresources fails.
Signed-off-by: Tomas Henzl <thenzl@redhat.com>
Acked-by: "Desai, Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 828003937711..2a52559058a9 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1635,6 +1635,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) | |||
1635 | } else { | 1635 | } else { |
1636 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", | 1636 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", |
1637 | ioc->name, pci_name(pdev)); | 1637 | ioc->name, pci_name(pdev)); |
1638 | pci_release_selected_regions(pdev, ioc->bars); | ||
1638 | return r; | 1639 | return r; |
1639 | } | 1640 | } |
1640 | } else { | 1641 | } else { |
@@ -1648,6 +1649,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) | |||
1648 | } else { | 1649 | } else { |
1649 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", | 1650 | printk(MYIOC_s_WARN_FMT "no suitable DMA mask for %s\n", |
1650 | ioc->name, pci_name(pdev)); | 1651 | ioc->name, pci_name(pdev)); |
1652 | pci_release_selected_regions(pdev, ioc->bars); | ||
1651 | return r; | 1653 | return r; |
1652 | } | 1654 | } |
1653 | } | 1655 | } |
@@ -1678,6 +1680,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) | |||
1678 | if (mem == NULL) { | 1680 | if (mem == NULL) { |
1679 | printk(MYIOC_s_ERR_FMT ": ERROR - Unable to map adapter" | 1681 | printk(MYIOC_s_ERR_FMT ": ERROR - Unable to map adapter" |
1680 | " memory!\n", ioc->name); | 1682 | " memory!\n", ioc->name); |
1683 | pci_release_selected_regions(pdev, ioc->bars); | ||
1681 | return -EINVAL; | 1684 | return -EINVAL; |
1682 | } | 1685 | } |
1683 | ioc->memmap = mem; | 1686 | ioc->memmap = mem; |