From 8e41597e1eabca1bbe291ffa44dc636f8cdebb41 Mon Sep 17 00:00:00 2001 From: Himanshu Agarwal Date: Wed, 12 Aug 2015 17:01:54 +0530 Subject: qcacld-2.0: Adding sanity check to prevent access of null txrx pdev While driver initialization, firmware crashes but system ignores it because of being in middle of driver initialization which leads to driver initialization timeout causing txrx pdev structure to remain uninitialized. While cleaning up of driver, WLANTL_Close passes NULL txrx pdev to ol_txrx_pdev_detach as an argument which in turn passes it to other functions which tries to access the contents of NULL txrx pdev causing system crash. This fix adds a sanity check right at the starting of the ol_txrx_pdev_detach function which returns the function back to WLANTL_Close if txrx pdev is NULL. CRs-Fixed: 888679 Change-Id: I320a299e223ecb294a4ea03d40996091480f1a39 --- CORE/CLD_TXRX/TXRX/ol_txrx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CORE/CLD_TXRX/TXRX/ol_txrx.c b/CORE/CLD_TXRX/TXRX/ol_txrx.c index bf3ce57670c5..edbe624a2839 100644 --- a/CORE/CLD_TXRX/TXRX/ol_txrx.c +++ b/CORE/CLD_TXRX/TXRX/ol_txrx.c @@ -822,6 +822,11 @@ void ol_txrx_pdev_detach(ol_txrx_pdev_handle pdev, int force) { int i; + /*checking to ensure txrx pdev structure is not NULL */ + if (!pdev) { + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "NULL pdev passed to %s\n", __func__); + return; + } /* preconditions */ TXRX_ASSERT2(pdev); -- cgit v1.2.3