summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSakthivel K <Sakthivel.SaravananKamalRaju@pmcs.com>2013-02-04 07:40:02 +0100
committerJames Bottomley <JBottomley@Parallels.com>2013-02-22 16:44:40 +0100
commitbfb4809f7fff2f2db3d0de41ea4f49fd3f2f0aa4 (patch)
treee6fafc6056c5ee6dd7d3b230fe2c09bfa6a6f2d2
parent[SCSI] megaraid_sas: Version and Changelog update (diff)
downloadlinux-bfb4809f7fff2f2db3d0de41ea4f49fd3f2f0aa4.tar.xz
linux-bfb4809f7fff2f2db3d0de41ea4f49fd3f2f0aa4.zip
[SCSI] pm80xx: fix for memory region free
All memory regions are allocated based on variables total_len and alignment but free was based on element_size. Signed-off-by: Sakthivel K <DL.Team.PMC.SPC.Linux.open.source@pmcs.com> Signed-off-by: Anand Kumar S <DL.Team.PMC.SPC.Linux.open.source@pmcs.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/pm8001/pm8001_init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 4c9fe733fe88..3d5e522e00fc 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -140,7 +140,8 @@ static void pm8001_free(struct pm8001_hba_info *pm8001_ha)
for (i = 0; i < USI_MAX_MEMCNT; i++) {
if (pm8001_ha->memoryMap.region[i].virt_ptr != NULL) {
pci_free_consistent(pm8001_ha->pdev,
- pm8001_ha->memoryMap.region[i].element_size,
+ (pm8001_ha->memoryMap.region[i].total_len +
+ pm8001_ha->memoryMap.region[i].alignment),
pm8001_ha->memoryMap.region[i].virt_ptr,
pm8001_ha->memoryMap.region[i].phys_addr);
}