1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

drm/panel: ili9341: fix optional regulator handling

If the optional regulator lookup fails, reset the pointer to NULL.
Other functions such as mipi_dbi_poweron_reset_conditional() only do
a NULL pointer check and will otherwise dereference the error pointer.

Fixes: 5a04227326 ("drm/panel: Add ilitek ili9341 panel driver")
Signed-off-by: Daniel Mack <daniel@zonque.org>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20220317225537.826302-1-daniel@zonque.org
This commit is contained in:
Daniel Mack 2022-03-17 23:55:37 +01:00 committed by Daniel Vetter
parent 3c3384050d
commit d14eb80e27

View file

@ -612,8 +612,10 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc,
int ret; int ret;
vcc = devm_regulator_get_optional(dev, "vcc"); vcc = devm_regulator_get_optional(dev, "vcc");
if (IS_ERR(vcc)) if (IS_ERR(vcc)) {
dev_err(dev, "get optional vcc failed\n"); dev_err(dev, "get optional vcc failed\n");
vcc = NULL;
}
dbidev = devm_drm_dev_alloc(dev, &ili9341_dbi_driver, dbidev = devm_drm_dev_alloc(dev, &ili9341_dbi_driver,
struct mipi_dbi_dev, drm); struct mipi_dbi_dev, drm);