Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a4f6d46 authored by Sathish Ambley's avatar Sathish Ambley
Browse files

msm: ADSPRPC: Call free only when allocation succeed



Call free only when allocation succeeded, otherwise skip freeing
remote heap memory.

Change-Id: I749c7956377764fe04e1b47898b4acb390c6b942
Acked-by: default avatarHimateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: default avatarSathish Ambley <sathishambley@codeaurora.org>
parent 188ab649
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -417,10 +417,12 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map)
			pr_err("failed to free remote heap allocation\n");
			return;
		}
		if (map->phys) {
			dma_set_attr(DMA_ATTR_SKIP_ZEROING, &attrs);
			dma_set_attr(DMA_ATTR_NO_KERNEL_MAPPING, &attrs);
			dma_free_attrs(me->adsp_mem_device, map->size,
					&(map->va), map->phys,	&attrs);
		}
	} else {
		if (!IS_ERR_OR_NULL(map->handle))
			ion_free(fl->apps->client, map->handle);