Please consider this patch as an ACKed. It has valid error handling in mpt_mapreousrces(). Thanks, Kashyap > -----Original Message----- > From: Tomas Henzl [mailto:thenzl@xxxxxxxxxx] > Sent: Monday, July 26, 2010 8:11 PM > To: 'linux-scsi@xxxxxxxxxxxxxxx' > Cc: James Bottomley; Desai, Kashyap; Moore, Eric; Prakash, Sathya > Subject: [PATCH] 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@xxxxxxxxxx> > --- > diff --git a/drivers/message/fusion/mptbase.c > b/drivers/message/fusion/mptbase.c > index e319abc..ea12663 100644 > --- a/drivers/message/fusion/mptbase.c > +++ b/drivers/message/fusion/mptbase.c > @@ -1632,6 +1632,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) > } else { > printk(MYIOC_s_WARN_FMT "no suitable DMA mask for > %s\n", > ioc->name, pci_name(pdev)); > + pci_release_selected_regions(pdev, ioc->bars); > return r; > } > } else { > @@ -1645,6 +1646,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) > } else { > printk(MYIOC_s_WARN_FMT "no suitable DMA mask for > %s\n", > ioc->name, pci_name(pdev)); > + pci_release_selected_regions(pdev, ioc->bars); > return r; > } > } > @@ -1675,6 +1677,7 @@ mpt_mapresources(MPT_ADAPTER *ioc) > if (mem == NULL) { > printk(MYIOC_s_ERR_FMT ": ERROR - Unable to map adapter" > " memory!\n", ioc->name); > + pci_release_selected_regions(pdev, ioc->bars); > return -EINVAL; > } > ioc->memmap = mem; > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html