[RAMEN9610-19587][COMMON] touchscreen: synaptics: Fix prevent issue
authorJaehyoung Choi <jkkkkk.choi@samsung.com>
Mon, 17 Jun 2019 07:11:22 +0000 (16:11 +0900)
committerKim Gunho <gunho.kim@samsung.com>
Mon, 9 Sep 2019 11:05:17 +0000 (20:05 +0900)
Change-Id: I56071262458b93028ffa703e7eba1094ae229c34
Signed-off-by: Jaehyoung Choi <jkkkkk.choi@samsung.com>
Signed-off-by: Kim Gunho <gunho.kim@samsung.com>
drivers/input/touchscreen/synaptics_dsx/synaptics_i2c_rmi.c

index 13a8914dab013e4521dcad9252aaa94aae478a13..5947803e995ea9d61b2a072a2e79078128a37f96 100644 (file)
@@ -2918,6 +2918,7 @@ static void synaptics_rmi4_free_fh(struct synaptics_rmi4_data *rmi4_data,
 {
 #ifdef PROXIMITY_MODE
        struct synaptics_rmi4_f51_handle *f51 = rmi4_data->f51;
+       static int is_f51_free = 0;
 #endif
 
        if (fhandler->fn_number == SYNAPTICS_RMI4_F1A) {
@@ -2925,8 +2926,13 @@ static void synaptics_rmi4_free_fh(struct synaptics_rmi4_data *rmi4_data,
        } else {
 #ifdef PROXIMITY_MODE
                if (fhandler->fn_number == SYNAPTICS_RMI4_F51) {
-                       kfree(f51);
-                       f51 = NULL;
+                       if (!is_f51_free) {
+                               kfree(f51);
+                               f51 = NULL;
+                               is_f51_free = 1;
+                       }
+                       else
+                               f51 = NULL;
                }
 #endif
                kfree(fhandler->data);