diff mbox series

drm/tve200: Fix smatch warning

Message ID 20220505215019.2332613-1-linus.walleij@linaro.org (mailing list archive)
State New, archived
Headers show
Series drm/tve200: Fix smatch warning | expand

Commit Message

Linus Walleij May 5, 2022, 9:50 p.m. UTC
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>
---
 drivers/gpu/drm/tve200/tve200_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Linus Walleij Aug. 26, 2022, 11:35 a.m. UTC | #1
On Thu, May 5, 2022 at 11:52 PM Linus Walleij <linus.walleij@linaro.org> wrote:

> 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>

Would someone show mercy on this patch and review it so I
can apply it?

Dan maybe? If it solves the problem you reported.

Yours,
Linus Walleij
Dan Carpenter Aug. 26, 2022, 12:05 p.m. UTC | #2
On Fri, Aug 26, 2022 at 01:35:56PM +0200, Linus Walleij wrote:
> On Thu, May 5, 2022 at 11:52 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> 
> > 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>
> 
> Would someone show mercy on this patch and review it so I
> can apply it?
> 
> Dan maybe? If it solves the problem you reported.

Yes.  This patch makes me happy.  Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

regards,
dan carpenter
Linus Walleij Aug. 26, 2022, 12:23 p.m. UTC | #3
On Fri, Aug 26, 2022 at 2:05 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Fri, Aug 26, 2022 at 01:35:56PM +0200, Linus Walleij wrote:
> > On Thu, May 5, 2022 at 11:52 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > > 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>
> >
> > Would someone show mercy on this patch and review it so I
> > can apply it?
> >
> > Dan maybe? If it solves the problem you reported.
>
> Yes.  This patch makes me happy.  Thanks!
>
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

Excellent, patch applied!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index 6d9d2921abf4..3f4fef574706 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -65,7 +65,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;
@@ -93,6 +93,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;
 	}