qcacld-3.0: Check for NULL pointer before de-referencing it

Pointer 'hif_ctx' returned from call to function 'cds_get_context'
may be NULL. Check for NULL pointer before de-referencing it.

Change-Id: I9d34d877783b35829faf2049c3c8c43519e12914
CRs-Fixed: 2726468
Bu işleme şunda yer alıyor:
Srinivas Girigowda
2020-07-07 13:32:09 -07:00
işlemeyi yapan: nshrivas
ebeveyn acf04962a7
işleme 942799962e

Dosyayı Görüntüle

@@ -1778,6 +1778,9 @@ static int _wlan_hdd_cfg80211_resume_wlan(struct wiphy *wiphy)
}
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);
@@ -2014,6 +2017,9 @@ static int _wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
}
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
if (!hif_ctx)
return -EINVAL;
errno = hif_pm_runtime_get_sync(hif_ctx, RTPM_ID_SUSPEND_RESUME);
if (errno)
return errno;