qcacld-3.0: Null-check context in hdd_set_netdev_flags

Add null check for 'hdd_ctx' and 'soc' before accessing them in
hdd_set_netdev_flags function.

Change-Id: I0fc115170943c402b522989d76b278ea1fbd4862
CRs-Fixed: 2706429
This commit is contained in:
Mohit Khanna
2020-06-09 12:03:35 -07:00
committato da nshrivas
parent 55bcf005c8
commit 8c40bf010d

Vedi File

@@ -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: