Pārlūkot izejas kodu

touch: raydium: Handle NULL reference

Handling NULL reference of input_dev during shutdown failure.

Change-Id: If303f4a4cb238272aa696617b57f9bbdd8959b55
Signed-off-by: Surya Teja Kudiri <[email protected]>
Surya Teja Kudiri 2 gadi atpakaļ
vecāks
revīzija
0ebf44a4f9
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      raydium/raydium_driver.c

+ 3 - 1
raydium/raydium_driver.c

@@ -2524,7 +2524,9 @@ if (active_panel)
 	drm_panel_notifier_unregister(active_panel, &g_raydium_ts->fb_notif);
 #endif/*end of CONFIG_FB*/
 	input_unregister_device(g_raydium_ts->input_dev);
-	input_free_device(g_raydium_ts->input_dev);
+	if (g_raydium_ts->input_dev)
+		input_free_device(g_raydium_ts->input_dev);
+	g_raydium_ts->input_dev = NULL;
 	gpio_free(g_raydium_ts->rst_gpio);
 
 #ifdef CONFIG_RM_SYSFS_DEBUG