diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index b8fe11f7e30b..6e906dafd357 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -7248,6 +7248,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(); @@ -7256,6 +7257,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 */