From baebf33071e53c10a5d6e889b878e0781a52a103 Mon Sep 17 00:00:00 2001 From: Konstantin Makariev Date: Tue, 4 Aug 2020 16:17:05 -0500 Subject: [PATCH] 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 Reviewed-on: https://gerrit.mot.com/1714293 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Igor Kovalenko Submit-Approved: Jira Key --- .../synaptics_mmi_class/synaptics_dsx_test_reporting.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/touchscreen/synaptics_mmi_class/synaptics_dsx_test_reporting.c b/drivers/input/touchscreen/synaptics_mmi_class/synaptics_dsx_test_reporting.c index 0527a84e6ff1..6438fcc70828 100644 --- a/drivers/input/touchscreen/synaptics_mmi_class/synaptics_dsx_test_reporting.c +++ b/drivers/input/touchscreen/synaptics_mmi_class/synaptics_dsx_test_reporting.c @@ -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,