mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
qcacld-3.0: Perform timing profiling after validating hdd_ctx
Pointer hdd_ctx returned from the call to function cds_get_context may be NULL and will be dereferenced. Move the recording of timing of runtime PM operations to after validation of hdd_ctx. Change-Id: I5da02c3fdb695be25bf0b59f4fe33e599e751d03 CRs-Fixed: 2524971
This commit is contained in:
parent
4036af67cb
commit
35cb57c797
1 changed files with 9 additions and 7 deletions
|
|
@ -1395,18 +1395,13 @@ static int hdd_pld_runtime_resume_cb(void)
|
|||
*/
|
||||
static int wlan_hdd_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
struct hdd_context *hdd_ctx;
|
||||
QDF_STATUS status;
|
||||
qdf_time_t delta;
|
||||
|
||||
hdd_debug("Starting runtime resume");
|
||||
hdd_ctx->runtime_resume_start_time_stamp =
|
||||
qdf_get_log_timestamp_usecs();
|
||||
delta = hdd_ctx->runtime_resume_start_time_stamp -
|
||||
hdd_ctx->runtime_suspend_done_time_stamp;
|
||||
hdd_debug("Starting runtime resume total cxpc down time %lu microseconds",
|
||||
delta);
|
||||
|
||||
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
if (wlan_hdd_validate_context(hdd_ctx))
|
||||
return 0;
|
||||
|
||||
|
|
@ -1415,6 +1410,13 @@ static int wlan_hdd_runtime_resume(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
hdd_ctx->runtime_resume_start_time_stamp =
|
||||
qdf_get_log_timestamp_usecs();
|
||||
delta = hdd_ctx->runtime_resume_start_time_stamp -
|
||||
hdd_ctx->runtime_suspend_done_time_stamp;
|
||||
hdd_debug("Starting runtime resume total cxpc down time %lu microseconds",
|
||||
delta);
|
||||
|
||||
status = ucfg_pmo_psoc_bus_runtime_resume(hdd_ctx->psoc,
|
||||
hdd_pld_runtime_resume_cb);
|
||||
if (status != QDF_STATUS_SUCCESS)
|
||||
|
|
|
|||
Loading…
Reference in a new issue