All memory regions are allocated based on variables total_len
and alignment but free was based on element_size.
Signed-off-by: Sakthivel K <[email protected]>
Signed-off-by: Anand Kumar S <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
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);
}