mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Input: atmel_mxt_ts - suspend/resume causes panic if input_dev fails to init
input_dev may be NULL if mxt_initialize_input_device fails. But pm ops is still available and suspend/resume assume input_dev is not NULL. To fix this issue, we add a check if (!input_dev). Signed-off-by: Pan Xinhui <[email protected]> Signed-off-by: Nick Dyer <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
This commit is contained in:
parent
146c6a662f
commit
50fabb02c7
1 changed files with 6 additions and 0 deletions
|
|
@ -2644,6 +2644,9 @@ static int __maybe_unused mxt_suspend(struct device *dev)
|
|||
struct mxt_data *data = i2c_get_clientdata(client);
|
||||
struct input_dev *input_dev = data->input_dev;
|
||||
|
||||
if (!input_dev)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&input_dev->mutex);
|
||||
|
||||
if (input_dev->users)
|
||||
|
|
@ -2660,6 +2663,9 @@ static int __maybe_unused mxt_resume(struct device *dev)
|
|||
struct mxt_data *data = i2c_get_clientdata(client);
|
||||
struct input_dev *input_dev = data->input_dev;
|
||||
|
||||
if (!input_dev)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&input_dev->mutex);
|
||||
|
||||
if (input_dev->users)
|
||||
|
|
|
|||
Loading…
Reference in a new issue