diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-11-04 10:39:41 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-04 19:17:34 +0100 |
commit | a4bf016b32ffd341ef2d62325d0f7963ec6a9dfc (patch) | |
tree | dcb831adeaa148d27af3a33bb4a946f3f2043e34 /drivers/input/touchscreen | |
parent | 185563ec11956ec1237d62fae80eab593ee63ca9 (diff) | |
download | linux-stable-a4bf016b32ffd341ef2d62325d0f7963ec6a9dfc.tar.gz linux-stable-a4bf016b32ffd341ef2d62325d0f7963ec6a9dfc.tar.bz2 linux-stable-a4bf016b32ffd341ef2d62325d0f7963ec6a9dfc.zip |
Input: ili210x - handle errors from input_mt_init_slots()
[ Upstream commit 43f06a4c639de8ee89fc348a9a3ecd70320a04dd ]
input_mt_init_slots() may fail and we need to handle such failures.
Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd
Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/ili210x.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index e9006407c9bc..f4ebdab06280 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -334,7 +334,12 @@ static int ili210x_i2c_probe(struct i2c_client *client, input_set_abs_params(input, ABS_MT_POSITION_X, 0, 0xffff, 0, 0); input_set_abs_params(input, ABS_MT_POSITION_Y, 0, 0xffff, 0, 0); touchscreen_parse_properties(input, true, &priv->prop); - input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT); + + error = input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT); + if (error) { + dev_err(dev, "Unable to set up slots, err: %d\n", error); + return error; + } error = devm_add_action(dev, ili210x_cancel_work, priv); if (error) |