diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cb9cfcad86..4e7141ad9a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6883,11 +6883,16 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter) hdd_err("invalid input!"); return; } + device_mode = adapter->device_mode; hdd_ctx = adapter->hdd_ctx; - device_mode = adapter->device_mode; soc = cds_get_context(QDF_MODULE_ID_SOC); + if (!soc || !hdd_ctx) { + hdd_err("invalid SOC or HDD context!"); + return; + } + /* Determine device_mode specific configuration */ switch (device_mode) { case QDF_NDI_MODE: