summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2018-05-11 13:00:13 +0530
committernshrivas <nshrivas@codeaurora.org>2018-05-15 06:01:09 -0700
commit4b42875ae896907c0addf5af183f4872522320e6 (patch)
tree0af20e3ed9705f887506715c0386f4a663457acd
parentabb7ed487e0a6be205cd3105338e42b67d883e0e (diff)
qcacld-3.0: Avoid NULL pointer access in cds regd api
In cds_get_reg_domain_from_country_code api hdd_ctx is getting used without NULL check which may be NULL. Add a check, if hdd_ctx is NULL, return error. Change-Id: I9b473d8b5310b247ba127ecb77849f51bef7faf3 CRs-Fixed: 2240419
-rw-r--r--core/cds/src/cds_reg_service.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c
index 07f57651d375..89dceffed3d8 100644
--- a/core/cds/src/cds_reg_service.c
+++ b/core/cds/src/cds_reg_service.c
@@ -639,14 +639,20 @@ QDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+ if (!hdd_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+ "hdd_ctx is NULL");
+ return QDF_STATUS_E_ENXIO;
+ }
+
if (cds_is_driver_unloading()) {
hdd_err("Driver is unloading can not open the hdd");
- return -EBUSY;
+ return QDF_STATUS_E_BUSY;
}
if (cds_is_driver_recovering()) {
hdd_err("WLAN is currently recovering; Please try again.");
- return -EBUSY;
+ return QDF_STATUS_E_BUSY;
}
if (NULL == reg_domain_ptr) {