drm/panel: magnachip: Prevent error pointer dereference in probe
authorDan Carpenter <error27@gmail.com>
Wed, 22 Mar 2023 09:07:10 +0000 (12:07 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 27 Mar 2023 21:23:00 +0000 (23:23 +0200)
Don't dereference "db->dsi_dev" when it is an error pointer.

Fixes: 249a4f5e663c ("drm/panel: Add Magnachip D53E6EA8966 Panel Driver")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/de0273a8-8910-4ac4-b4ed-f7691c4d2ca6@kili.mountain
drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c

index 8c362c4..26d358b 100644 (file)
@@ -418,7 +418,7 @@ static int d53e6ea8966_probe(struct spi_device *spi)
        if (IS_ERR(db->dsi_dev)) {
                dev_err(dev, "failed to register dsi device: %ld\n",
                        PTR_ERR(db->dsi_dev));
-               ret = PTR_ERR(db->dsi_dev);
+               return PTR_ERR(db->dsi_dev);
        }
 
        db->dsi_dev->lanes = 2;