瀏覽代碼

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
Saket Jha 4 年之前
父節點
當前提交
91f3420b3d
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      qdf/linux/src/qdf_nbuf.c

+ 4 - 2
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;
 			}
 		}