drm/panel/raspberrypi-touchscreen: Avoid NULL deref if not initialised
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Fri, 15 Apr 2022 16:25:12 +0000 (18:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 12:38:59 +0000 (14:38 +0200)
commit7981351a916e393cd3f350aaded3d9262a728655
tree6232639a06142f40d2e0449e2fe57420909a8e87
parent56637084e8a551e7896d846f1e96415681973cbd
drm/panel/raspberrypi-touchscreen: Avoid NULL deref if not initialised

[ Upstream commit f92055ae0acb035891e988ce345d6b81a0316423 ]

If a call to rpi_touchscreen_i2c_write from rpi_touchscreen_probe
fails before mipi_dsi_device_register_full is called, then
in trying to log the error message if uses ts->dsi->dev when
it is still NULL.

Use ts->i2c->dev instead, which is initialised earlier in probe.

Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220415162513.42190-2-stefan.wahren@i2se.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c