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:
@@ -6883,11 +6883,16 @@ void hdd_set_netdev_flags(struct hdd_adapter *adapter)
|
|||||||
hdd_err("invalid input!");
|
hdd_err("invalid input!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
device_mode = adapter->device_mode;
|
||||||
|
|
||||||
hdd_ctx = adapter->hdd_ctx;
|
hdd_ctx = adapter->hdd_ctx;
|
||||||
device_mode = adapter->device_mode;
|
|
||||||
soc = cds_get_context(QDF_MODULE_ID_SOC);
|
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 */
|
/* Determine device_mode specific configuration */
|
||||||
switch (device_mode) {
|
switch (device_mode) {
|
||||||
case QDF_NDI_MODE:
|
case QDF_NDI_MODE:
|
||||||
|
Reference in New Issue
Block a user