mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
goodix_gtx8_v1430_mmi: fix kernel panic
There are 2 failure cases when core data structure gets released and external modules have no knowledge of it. Kernel panics attempting to address memory that was released already. This change ensures core data pointer of external modules structure only valied when device probed successfully. Change-Id: I4d2ddbb9c8010aba113afd5bff56a1496502bcd1 Signed-off-by: Konstantin Makariev <hcv867@motorola.com> Reviewed-on: https://gerrit.mot.com/1446705 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Konstantin Makariev <kmakariev@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
5e5e732df9
commit
b50e5b65f8
1 changed files with 5 additions and 2 deletions
|
|
@ -2187,9 +2187,10 @@ static int goodix_ts_probe(struct platform_device *pdev)
|
|||
out:
|
||||
if (r)
|
||||
core_data->initialized = 0;
|
||||
else
|
||||
else {
|
||||
core_data->initialized = 1;
|
||||
goodix_modules.core_data = core_data;
|
||||
goodix_modules.core_data = core_data;
|
||||
}
|
||||
ts_info("goodix_ts_probe OUT, r:%d", r);
|
||||
/* wakeup ext module register work */
|
||||
complete_all(&goodix_modules.core_comp);
|
||||
|
|
@ -2201,6 +2202,7 @@ static int goodix_ts_remove(struct platform_device *pdev)
|
|||
struct goodix_ts_core *core_data = platform_get_drvdata(pdev);
|
||||
|
||||
core_data->initialized = 0;
|
||||
goodix_ts_unregister_notifier(&core_data->ts_notifier);
|
||||
if (atomic_read(&core_data->ts_esd.esd_on))
|
||||
goodix_ts_esd_off(core_data);
|
||||
goodix_remove_all_ext_modules();
|
||||
|
|
@ -2263,5 +2265,6 @@ int goodix_ts_core_release(struct goodix_ts_core *core_data)
|
|||
|
||||
platform_driver_unregister(&goodix_ts_driver);
|
||||
goodix_ts_dev_release();
|
||||
goodix_modules.core_data = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue