qcacld-3.0: Add sanity check for hdd context

Add sanity check for hdd context and return if
hdd context is null.

Change-Id: Ibef56ee7d0b0505643e04583a78b4924e4bc20bf
CRs-Fixed: 2462701
This commit is contained in:
Rajeev Kumar 2019-05-31 12:04:27 -07:00 • committed by nshrivas
commit d62104a8b0

View file

@ -9267,6 +9267,11 @@ int hdd_psoc_idle_shutdown(struct device *dev)
{
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err_rl("hdd ctx is null");
return -EINVAL;
}
if (is_mode_change_psoc_idle_shutdown)
return __hdd_mode_change_psoc_idle_shutdown(hdd_ctx);
else
@ -9282,6 +9287,11 @@ int hdd_psoc_idle_restart(struct device *dev)
{
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (!hdd_ctx) {
hdd_err_rl("hdd ctx is null");
return -EINVAL;
}
return __hdd_psoc_idle_restart(hdd_ctx);
}