Commit 50fabb02 authored by Pan Xinhui's avatar Pan Xinhui Committed by Dmitry Torokhov

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: default avatarPan Xinhui <xinhuix.pan@intel.com>
Signed-off-by: default avatarNick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 146c6a66
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment