]> Git Repo - linux.git/commitdiff
drm/panel: ili9341: fix optional regulator handling
authorDaniel Mack <[email protected]>
Thu, 17 Mar 2022 22:55:37 +0000 (23:55 +0100)
committerDaniel Vetter <[email protected]>
Fri, 18 Mar 2022 10:08:42 +0000 (11:08 +0100)
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: 5a04227326b04c15 ("drm/panel: Add ilitek ili9341 panel driver")
Signed-off-by: Daniel Mack <[email protected]>
Cc: [email protected]
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/panel/panel-ilitek-ili9341.c

index 2c3378a259b1e12baf6f246fc4e1841416ee40b6..e1542451ef9d07a6ac2d246cb0ce41cc9f230fa6 100644 (file)
@@ -612,8 +612,10 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc,
        int ret;
 
        vcc = devm_regulator_get_optional(dev, "vcc");
-       if (IS_ERR(vcc))
+       if (IS_ERR(vcc)) {
                dev_err(dev, "get optional vcc failed\n");
+               vcc = NULL;
+       }
 
        dbidev = devm_drm_dev_alloc(dev, &ili9341_dbi_driver,
                                    struct mipi_dbi_dev, drm);
This page took 0.045202 seconds and 4 git commands to generate.