diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index d7571f95f00a..00d00218ca64 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1210,6 +1210,8 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params) hdd_info("starting bus suspend"); hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) + return -ENODEV; err = wlan_hdd_validate_context(hdd_ctx); if (0 != err) { @@ -1922,6 +1924,8 @@ static int wlan_hdd_pld_suspend(struct device *dev, struct hdd_context *hdd_ctx; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) + return -ENODEV; errno = wlan_hdd_validate_context(hdd_ctx); if (0 != errno) {