From f9f659735aea48409814cba4770ede4b5bb9fb5e Mon Sep 17 00:00:00 2001 From: Mohit Khanna Date: Fri, 24 Feb 2017 19:23:57 -0800 Subject: [PATCH] qcacld-3.0: Fix TSO seg cookie init crash In one of the recent fixes, we are setting the TSO seg contents to zero when the segment is added back to the free list. The segment cookie is not re-initalized at this point. Hence, when this segment is re-allocated, it fails the cookie check and there is a system crash. Fix the issue by reinitializing the segment cookie after zero-ing out its contents. Change-Id: I7947e3ce4f80f1b19ebf5ef73ff75dee19ec7364 CRs-Fixed: 2011786 --- core/dp/txrx/ol_tx_desc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/dp/txrx/ol_tx_desc.c b/core/dp/txrx/ol_tx_desc.c index 3455bd45e9f4..a417a2e05128 100644 --- a/core/dp/txrx/ol_tx_desc.c +++ b/core/dp/txrx/ol_tx_desc.c @@ -825,6 +825,7 @@ void ol_tso_free_segment(struct ol_txrx_pdev_t *pdev, qdf_mem_zero(tso_seg, sizeof(*tso_seg)); tso_seg->next = pdev->tso_seg_pool.freelist; tso_seg->on_freelist = 1; + tso_seg->cookie = TSO_SEG_MAGIC_COOKIE; pdev->tso_seg_pool.freelist = tso_seg; pdev->tso_seg_pool.num_free++; qdf_spin_unlock_bh(&pdev->tso_seg_pool.tso_mutex);