From 61a9fa154d217c13eea90aa5bc635bc4b1fcb66e Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Thu, 5 May 2022 23:50:19 +0200 Subject: [PATCH] drm/tve200: Fix smatch warning 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 Signed-off-by: Linus Walleij Reviewed-by: Dan Carpenter Link: https://patchwork.freedesktop.org/patch/msgid/20220505215019.2332613-1-linus.walleij@linaro.org --- drivers/gpu/drm/tve200/tve200_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c index 79d790ae1670..04db72e3fa9c 100644 --- a/drivers/gpu/drm/tve200/tve200_drv.c +++ b/drivers/gpu/drm/tve200/tve200_drv.c @@ -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; }