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

Commit abb73bf0 authored by Ashok Vuyyuru's avatar Ashok Vuyyuru Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa3: Fix to check DMA address valid or not before unmap



Add check before unmapping the dma address was valid or not.

Change-Id: Ic2444b2247be0a0129617cfc727c8d3c8394a56b
Signed-off-by: default avatarAshok Vuyyuru <avuyyuru@codeaurora.org>
parent 0ce2ea25
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2484,8 +2484,11 @@ static void ipa3_cleanup_rx(struct ipa3_sys_context *sys)
	list_for_each_entry_safe(rx_pkt, r,
				 &sys->rcycl_list, link) {
		list_del(&rx_pkt->link);
		if (rx_pkt->data.dma_addr)
			dma_unmap_single(ipa3_ctx->pdev, rx_pkt->data.dma_addr,
				sys->rx_buff_sz, DMA_FROM_DEVICE);
		else
			IPADBG("DMA address already freed\n");
		sys->free_skb(rx_pkt->data.skb);
		kmem_cache_free(ipa3_ctx->rx_pkt_wrapper_cache, rx_pkt);
	}