drm/tve200: Fix smatch warning
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 5 May 2022 21:50:19 +0000 (23:50 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 26 Aug 2022 12:22:59 +0000 (14:22 +0200)
The "ret" variable is ambiguously returning something that
could be zero in the tve200_modeset_init() function, assign
it an explicit error return code to make this unambiguous.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220505215019.2332613-1-linus.walleij@linaro.org
drivers/gpu/drm/tve200/tve200_drv.c

index 79d790a..04db72e 100644 (file)
@@ -64,7 +64,7 @@ static int tve200_modeset_init(struct drm_device *dev)
        struct tve200_drm_dev_private *priv = dev->dev_private;
        struct drm_panel *panel;
        struct drm_bridge *bridge;
-       int ret = 0;
+       int ret;
 
        drm_mode_config_init(dev);
        mode_config = &dev->mode_config;
@@ -92,6 +92,7 @@ static int tve200_modeset_init(struct drm_device *dev)
                 * method to get the connector out of the bridge.
                 */
                dev_err(dev->dev, "the bridge is not a panel\n");
+               ret = -EINVAL;
                goto out_bridge;
        }