diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index c54eb118fb2f..ed45963c109b 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1896,6 +1896,10 @@ static int _wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) struct hdd_context *hdd_ctx = wiphy_priv(wiphy); int errno; + hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + if (hif_ctx) + hif_pm_runtime_put(hif_ctx, RTPM_ID_SUSPEND_RESUME); + if (!hdd_ctx) { hdd_err_rl("hdd context is null"); return -ENODEV; @@ -1911,12 +1915,8 @@ static int _wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy) if (errno) return errno; - hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); - if (!hif_ctx) - return -EINVAL; errno = __wlan_hdd_cfg80211_resume_wlan(wiphy); - hif_pm_runtime_put(hif_ctx, RTPM_ID_SUSPEND_RESUME); return errno; }