qcacld-3.0: add NULL check before soc dereference

This is to fix the error of missing soc NULL check.
Before dereferencing soc for decoding pdev handle,
add the NULL check for soc.

Change-Id: Idade64fd88790e9a6faffceb99fc42dcd683677d
CRs-Fixed: 2668317
This commit is contained in:
Vevek Venkatesan
2020-04-28 20:35:37 +05:30
committed by nshrivas
parent 9fb79b9693
commit 3acd66498f

View File

@@ -72,20 +72,23 @@ wdi_event_handler(enum WDI_EVENT event,
uint32_t event_index; uint32_t event_index;
wdi_event_subscribe *wdi_sub; wdi_event_subscribe *wdi_sub;
struct ol_txrx_soc_t *soc = cds_get_context(QDF_MODULE_ID_SOC); struct ol_txrx_soc_t *soc = cds_get_context(QDF_MODULE_ID_SOC);
ol_txrx_pdev_handle txrx_pdev = ol_txrx_pdev_handle txrx_pdev;
ol_txrx_get_pdev_from_pdev_id(soc, pdev_id);
/* /*
* Input validation * Input validation
*/ */
if (!event) { if (!event) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, ol_txrx_err("Invalid WDI event");
"Invalid WDI event in %s\n", __func__);
return; return;
} }
if (!soc) {
ol_txrx_err("Invalid soc");
return;
}
txrx_pdev = ol_txrx_get_pdev_from_pdev_id(soc, pdev_id);
if (!txrx_pdev) { if (!txrx_pdev) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, ol_txrx_err("Invalid pdev");
"Invalid pdev in WDI event handler\n");
return; return;
} }
/* /*