From 91f3420b3db4242ef734003ed6c3a16e239bc04b Mon Sep 17 00:00:00 2001 From: Saket Jha Date: Thu, 17 Sep 2020 11:58:38 -0700 Subject: [PATCH] qcacmn: Always assert if TSO frag paddr is invalid Always assert immediately in case of dma mapping error for TSO frags or whenever paddr is set to 0. This will assert closer to the point of failure in the future and point to the immediate operation causing this behavior. Change-Id: I8e3d58c1b4f18a8b7721b96686ea0ea4ff9c270b CRs-Fixed: 2777588 --- qdf/linux/src/qdf_nbuf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c index e69dea5596..70800ba044 100644 --- a/qdf/linux/src/qdf_nbuf.c +++ b/qdf/linux/src/qdf_nbuf.c @@ -3253,7 +3253,7 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb, if (unlikely(dma_mapping_error(osdev->dev, tso_frag_paddr))) { qdf_err("DMA mapping error!"); - qdf_assert(0); + qdf_assert_always(0); return 0; } TSO_DEBUG("%s[%d] skb frag len %d tso frag len %d\n", __func__, @@ -3302,6 +3302,8 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb, tso_cmn_info.tcp_seq_num += tso_frag_len; curr_seg->seg.tso_frags[i].paddr = tso_frag_paddr; + + qdf_assert_always(curr_seg->seg.tso_frags[i].paddr); } TSO_DEBUG("%s[%d] frag %d frag len %d total_len %u vaddr %pK\n", @@ -3386,7 +3388,7 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb, if (unlikely(dma_mapping_error(osdev->dev, tso_frag_paddr))) { qdf_err("DMA mapping error!"); - qdf_assert(0); + qdf_assert_always(0); return 0; } }