All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/plane-helper: fix uninitialized variable reference
       [not found] <20210907140836.323149-1-alex_y_xu.ref@yahoo.ca>
@ 2021-09-07 14:08 ` Alex Xu (Hello71)
  2021-09-08 18:34   ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Xu (Hello71) @ 2021-09-07 14:08 UTC (permalink / raw)
  To: dri-devel; +Cc: ville.syrjala, linux-kernel, Alex Xu (Hello71)

drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_update':
drivers/gpu/drm/drm_plane_helper.c:113:32: error: 'visible' is used uninitialized [-Werror=uninitialized]
  113 |         struct drm_plane_state plane_state = {
      |                                ^~~~~~~~~~~
drivers/gpu/drm/drm_plane_helper.c:178:14: note: 'visible' was declared here
  178 |         bool visible;
      |              ^~~~~~~
cc1: all warnings being treated as errors

visible is an output, not an input. in practice this use might turn out
OK but it's still UB.

Fixes: df86af9133 ("drm/plane-helper: Add drm_plane_helper_check_state()")
---
 drivers/gpu/drm/drm_plane_helper.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 5b2d0ca03705..838b32b70bce 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -123,7 +123,6 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,
 		.crtc_w = drm_rect_width(dst),
 		.crtc_h = drm_rect_height(dst),
 		.rotation = rotation,
-		.visible = *visible,
 	};
 	struct drm_crtc_state crtc_state = {
 		.crtc = crtc,
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/plane-helper: fix uninitialized variable reference
  2021-09-07 14:08 ` [PATCH] drm/plane-helper: fix uninitialized variable reference Alex Xu (Hello71)
@ 2021-09-08 18:34   ` Daniel Vetter
  2021-09-09  1:32     ` [PATCH v2] " Alex Xu (Hello71)
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2021-09-08 18:34 UTC (permalink / raw)
  To: Alex Xu (Hello71); +Cc: dri-devel, ville.syrjala, linux-kernel

On Tue, Sep 07, 2021 at 10:08:36AM -0400, Alex Xu (Hello71) wrote:
> drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_update':
> drivers/gpu/drm/drm_plane_helper.c:113:32: error: 'visible' is used uninitialized [-Werror=uninitialized]
>   113 |         struct drm_plane_state plane_state = {
>       |                                ^~~~~~~~~~~
> drivers/gpu/drm/drm_plane_helper.c:178:14: note: 'visible' was declared here
>   178 |         bool visible;
>       |              ^~~~~~~
> cc1: all warnings being treated as errors
> 
> visible is an output, not an input. in practice this use might turn out
> OK but it's still UB.
> 
> Fixes: df86af9133 ("drm/plane-helper: Add drm_plane_helper_check_state()")

I need a signed-off-by from you before I can merge this. See

https://dri.freedesktop.org/docs/drm/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin

Patch lgtm otherwise.
-Daniel

> ---
>  drivers/gpu/drm/drm_plane_helper.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
> index 5b2d0ca03705..838b32b70bce 100644
> --- a/drivers/gpu/drm/drm_plane_helper.c
> +++ b/drivers/gpu/drm/drm_plane_helper.c
> @@ -123,7 +123,6 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,
>  		.crtc_w = drm_rect_width(dst),
>  		.crtc_h = drm_rect_height(dst),
>  		.rotation = rotation,
> -		.visible = *visible,
>  	};
>  	struct drm_crtc_state crtc_state = {
>  		.crtc = crtc,
> -- 
> 2.33.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] drm/plane-helper: fix uninitialized variable reference
  2021-09-08 18:34   ` Daniel Vetter
@ 2021-09-09  1:32     ` Alex Xu (Hello71)
  2021-09-09  9:34       ` Simon Ser
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Xu (Hello71) @ 2021-09-09  1:32 UTC (permalink / raw)
  To: dri-devel; +Cc: ville.syrjala, linux-kernel, Alex Xu (Hello71)

drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_update':
drivers/gpu/drm/drm_plane_helper.c:113:32: error: 'visible' is used uninitialized [-Werror=uninitialized]
  113 |         struct drm_plane_state plane_state = {
      |                                ^~~~~~~~~~~
drivers/gpu/drm/drm_plane_helper.c:178:14: note: 'visible' was declared here
  178 |         bool visible;
      |              ^~~~~~~
cc1: all warnings being treated as errors

visible is an output, not an input. in practice this use might turn out
OK but it's still UB.

Fixes: df86af9133 ("drm/plane-helper: Add drm_plane_helper_check_state()")
Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
---
 drivers/gpu/drm/drm_plane_helper.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 5b2d0ca03705..838b32b70bce 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -123,7 +123,6 @@ static int drm_plane_helper_check_update(struct drm_plane *plane,
 		.crtc_w = drm_rect_width(dst),
 		.crtc_h = drm_rect_height(dst),
 		.rotation = rotation,
-		.visible = *visible,
 	};
 	struct drm_crtc_state crtc_state = {
 		.crtc = crtc,
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] drm/plane-helper: fix uninitialized variable reference
  2021-09-09  1:32     ` [PATCH v2] " Alex Xu (Hello71)
@ 2021-09-09  9:34       ` Simon Ser
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Ser @ 2021-09-09  9:34 UTC (permalink / raw)
  To: Alex Xu (Hello71); +Cc: dri-devel, ville.syrjala, linux-kernel

Reviewed-by: Simon Ser <contact@emersion.fr>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-09  9:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210907140836.323149-1-alex_y_xu.ref@yahoo.ca>
2021-09-07 14:08 ` [PATCH] drm/plane-helper: fix uninitialized variable reference Alex Xu (Hello71)
2021-09-08 18:34   ` Daniel Vetter
2021-09-09  1:32     ` [PATCH v2] " Alex Xu (Hello71)
2021-09-09  9:34       ` Simon Ser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.