synaptics_mmi_class: remove handler fix

External function insertion can be delayed due to ongoing firmware
update. However, detection work will still run remove handler if
function needs to be re-inserted. Check handle for NULL in remove
handler to avoid kernel panic.

Change-Id: I87282155d375548b140b8086cee59dde9a552884
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1714293
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Konstantin Makariev 2020-08-04 16:17:05 -05:00 • committed by Konstantin Makariev
commit baebf33071

View file

@ -5953,6 +5953,10 @@ static void __exit rmi4_f54_module_exit(void)
while ((next = synaptics_driver_getdata(next)) != NULL) {
f54 = (struct synaptics_rmi4_f54_handle *)next->f54_data;
/* f54 can be NULL when function */
/* has not been inserted yet */
if (f54 == NULL)
continue;
init_completion(&f54->remove_complete);
synaptics_rmi4_new_function(next, RMI_F54, false,
synaptics_rmi4_f54_init,