From: Daniel Vetter <daniel@ffwll.ch>
To: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Cc: dri-devel@lists.freedesktop.org, ville.syrjala@linux.intel.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/plane-helper: fix uninitialized variable reference
Date: Wed, 8 Sep 2021 20:34:40 +0200 [thread overview]
Message-ID: <YTkCQCPwZPbhMfeF@phenom.ffwll.local> (raw)
In-Reply-To: <20210907140836.323149-1-alex_y_xu@yahoo.ca>
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
next prev parent reply other threads:[~2021-09-08 18:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 [this message]
2021-09-09 1:32 ` [PATCH v2] " Alex Xu (Hello71)
2021-09-09 9:34 ` Simon Ser
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YTkCQCPwZPbhMfeF@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=alex_y_xu@yahoo.ca \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox