qcacld-3.0: add check for qdf_ctx
Add NULL check for qdf_ctx to avoid dereference. Change-Id: I75f5f2baafdf6b9c1a7587a3d17934c9246acccd CRs-Fixed: 2326306
This commit is contained in:
@@ -2606,6 +2606,11 @@ bool cds_is_fw_down(void)
|
|||||||
qdf_device_t qdf_ctx;
|
qdf_device_t qdf_ctx;
|
||||||
|
|
||||||
qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
|
qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
|
||||||
|
if (!qdf_ctx) {
|
||||||
|
cds_err("cds context is invalid");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return pld_is_fw_down(qdf_ctx->dev);
|
return pld_is_fw_down(qdf_ctx->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user