From 21e7bf0a3a945f926a010fc5dd86b8f26b90a340 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Mon, 4 Jul 2016 14:06:38 +0530 Subject: [PATCH] qcacld-3.0: Move NULL check before dereferencing pdev Move NULL check before dereferencing pdev in ol_tx_create_flow_pool Change-Id: I42398c9473690a0a8f70f35cc7d5aac87c4ec7e7 CRs-fixed: 1034748 --- core/dp/txrx/ol_txrx_flow_control.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/dp/txrx/ol_txrx_flow_control.c b/core/dp/txrx/ol_txrx_flow_control.c index fff6b114bfb1..ab4af41bcc09 100644 --- a/core/dp/txrx/ol_txrx_flow_control.c +++ b/core/dp/txrx/ol_txrx_flow_control.c @@ -336,17 +336,17 @@ struct ol_tx_flow_pool_t *ol_tx_create_flow_pool(uint8_t flow_pool_id, uint16_t size = 0, i; struct ol_tx_desc_t *tx_desc; union ol_tx_desc_list_elem_t *temp_list = NULL; - uint32_t stop_threshold = - ol_cfg_get_tx_flow_stop_queue_th(pdev->ctrl_pdev); - uint32_t start_threshold = stop_threshold + - ol_cfg_get_tx_flow_start_queue_offset(pdev->ctrl_pdev); + uint32_t stop_threshold; + uint32_t start_threshold; if (!pdev) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: pdev is NULL\n", __func__); return NULL; } - + stop_threshold = ol_cfg_get_tx_flow_stop_queue_th(pdev->ctrl_pdev); + start_threshold = stop_threshold + + ol_cfg_get_tx_flow_start_queue_offset(pdev->ctrl_pdev); pool = qdf_mem_malloc(sizeof(*pool)); if (!pool) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,