diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index f38227e660748..633d772d6ae8a 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -5458,6 +5458,11 @@ static uint32_t ol_txrx_get_cfg(void *soc, enum cdp_dp_cfg cfg) ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX); uint32_t value = 0; + if (!pdev) { + qdf_print("pdev is NULL"); + return 0; + } + cfg_ctx = (struct txrx_pdev_cfg_t *)(pdev->ctrl_pdev); switch (cfg) { case cfg_dp_enable_data_stall: diff --git a/core/dp/txrx/ol_txrx_ipa.c b/core/dp/txrx/ol_txrx_ipa.c index acb0568438120..ef21b3160eef8 100644 --- a/core/dp/txrx/ol_txrx_ipa.c +++ b/core/dp/txrx/ol_txrx_ipa.c @@ -912,6 +912,12 @@ static inline void ol_txrx_ipa_tx_params( { qdf_device_t osdev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + if (!osdev) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "%s: qdf device is null!", __func__); + return; + } + QDF_IPA_PIPE_IN_DL_COMP_RING_BASE_PA(pipe_in) = qdf_mem_get_dma_addr(osdev, &ipa_res->tx_comp_ring->mem_info); @@ -939,6 +945,14 @@ static inline void ol_txrx_ipa_rx_params( struct ol_txrx_ipa_resources *ipa_res, qdf_ipa_wdi_in_params_t *pipe_in) { + qdf_device_t osdev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + + if (!osdev) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "%s: qdf device is null!", __func__); + return; + } + QDF_IPA_PIPE_IN_UL_RDY_RING_BASE_PA(pipe_in) = ipa_res->rx_rdy_ring->mem_info.pa; QDF_IPA_PIPE_IN_UL_RDY_RING_SIZE(pipe_in) = @@ -946,7 +960,7 @@ static inline void ol_txrx_ipa_rx_params( QDF_IPA_PIPE_IN_UL_RDY_RING_RP_PA(pipe_in) = ipa_res->rx_proc_done_idx->mem_info.pa; OL_TXRX_IPA_WDI2_SET(pipe_in, ipa_res, - cds_get_context(QDF_MODULE_ID_QDF_DEVICE)); + osdev); } /** @@ -978,6 +992,12 @@ QDF_STATUS ol_txrx_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb, int ret; + if (!osdev) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "%s: qdf device is null!", __func__); + return QDF_STATUS_E_NOENT; + } + qdf_mem_zero(&pipe_in, sizeof(pipe_in)); qdf_mem_zero(&pipe_out, sizeof(pipe_out));