Эх сурвалжийг харах

touch: raydium: Handling NULL reference

Handing NULL reference of input_dev during probe failure.

Change-Id: I1c41773d0fa4892940e6faae044c211d21095901
Signed-off-by: Surya Teja Kudiri <[email protected]>
Surya Teja Kudiri 2 жил өмнө
parent
commit
a69bc36df5

+ 4 - 1
raydium/raydium_driver.c

@@ -2467,9 +2467,12 @@ exit_irq_request_failed:
 
 	cancel_work_sync(&g_raydium_ts->work);
 	input_unregister_device(input_dev);
+	g_raydium_ts->input_dev = NULL;
 
 exit_input_register_device_failed:
-	input_free_device(input_dev);
+	if (g_raydium_ts->input_dev)
+		input_free_device(input_dev);
+	g_raydium_ts->input_dev = NULL;
 
 exit_input_dev_alloc_failed:
 exit_check_i2c: