diff options
| author | Ashish Kumar Dhanotiya <adhanoti@codeaurora.org> | 2017-03-14 14:57:45 +0530 |
|---|---|---|
| committer | Sandeep Puligilla <spuligil@codeaurora.org> | 2017-03-14 15:58:48 -0700 |
| commit | 3e7f9213a0bc515630d888a3e8c724fa81bd9e16 (patch) | |
| tree | a2b4e823a32e35812262671972db543e0a287160 | |
| parent | 791a50c980a6ff409ec56c03b0790c55bd946e11 (diff) | |
qcacld-3.0: Check module status before processing driver command
If the driver module is closed do not process the driver command,
it will lead to a crash by accesssing uninitialized lock.
To handle this issue check the module status before processing
driver command and if module is closed, simply return error.
Change-Id: Ic651e1abdf6b2efa27e57695c04ace249f9d21bb
CRs-Fixed: 2018746
| -rw-r--r-- | core/hdd/src/wlan_hdd_ioctl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index a6fa64d1cd87..7c5c0763843f 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -7010,6 +7010,7 @@ static int hdd_driver_command(hdd_adapter_t *adapter, { uint8_t *command = NULL; int ret = 0; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); ENTER(); @@ -7018,6 +7019,15 @@ static int hdd_driver_command(hdd_adapter_t *adapter, return -EINVAL; } + ret = wlan_hdd_validate_context(hdd_ctx); + if (ret) + return ret; + + if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) { + hdd_err("Driver module is closed; command can not be processed"); + return -EINVAL; + } + /* * Note that valid pointers are provided by caller */ |
