msm: vidc: Fix crash due to invalid instance access
Invalid instance access can happen in sys error handler as instance can be deleted after core lock is released. Add change to print all instance info within core lock to avoid access to invalid instance. Change-Id: Ib4090730d347b9865f211e9cf22d30951739f741 Signed-off-by: Surajit Podder <spodder@codeaurora.org>
This commit is contained in:
parent
336e245503
commit
e5fdaa6b3b
1 changed files with 2 additions and 10 deletions
|
@ -1693,19 +1693,11 @@ static void handle_sys_error(enum hal_command_response cmd, void *data)
|
||||||
dprintk(VIDC_ERR,
|
dprintk(VIDC_ERR,
|
||||||
"SYS_ERROR can potentially crash the system\n");
|
"SYS_ERROR can potentially crash the system\n");
|
||||||
|
|
||||||
/*
|
|
||||||
* For SYS_ERROR, there will not be any inst pointer.
|
|
||||||
* Just grab one of the inst from instances list and
|
|
||||||
* use it.
|
|
||||||
*/
|
|
||||||
|
|
||||||
mutex_lock(&core->lock);
|
mutex_lock(&core->lock);
|
||||||
inst = list_first_entry_or_null(&core->instances,
|
list_for_each_entry(inst, &core->instances, list)
|
||||||
struct msm_vidc_inst, list);
|
msm_comm_print_inst_info(inst);
|
||||||
mutex_unlock(&core->lock);
|
mutex_unlock(&core->lock);
|
||||||
|
|
||||||
msm_comm_print_debug_info(inst);
|
|
||||||
|
|
||||||
BUG_ON(core->resources.debug_timeout);
|
BUG_ON(core->resources.debug_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue