diff mbox series

drm/mcde: Fix uninitialized value

Message ID 20201119140707.1008407-1-linus.walleij@linaro.org
State Accepted
Commit 3a78f064a679e44cbd77df9fcb30ebac32f5b46a
Headers show
Series drm/mcde: Fix uninitialized value | expand

Commit Message

Linus Walleij Nov. 19, 2020, 2:07 p.m. UTC
"val" isn't initialized on the default: errorpath.
Just return from the function if this happens.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/gpu/drm/mcde/mcde_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.26.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Sam Ravnborg Nov. 23, 2020, 9:37 p.m. UTC | #1
On Thu, Nov 19, 2020 at 03:07:07PM +0100, Linus Walleij wrote:
> "val" isn't initialized on the default: errorpath.

> Just return from the function if this happens.

> 

> Reported-by: kernel test robot <lkp@intel.com>

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

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Sam Ravnborg <sam@ravnborg.org>


In the same function - it looks like a bug that the code
returns when it sees a MCDE_CHANNEL_3 - line 524.

	Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mcde/mcde_display.c b/drivers/gpu/drm/mcde/mcde_display.c
index 192e11c88d72..d941026b940c 100644
--- a/drivers/gpu/drm/mcde/mcde_display.c
+++ b/drivers/gpu/drm/mcde/mcde_display.c
@@ -569,7 +569,7 @@  static void mcde_configure_channel(struct mcde *mcde, enum mcde_channel ch,
 	default:
 		dev_err(mcde->dev, "unknown flow mode %d\n",
 			mcde->flow_mode);
-		break;
+		return;
 	}
 
 	writel(val, mcde->regs + sync);