mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Advait Dhamorikar <advaitdhamorikar@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	Boris Brezillon <bbrezillon@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, anupnewsmail@gmail.com,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] drm/atmel_hlcdc: Fix uninitialized variable
Date: Fri, 4 Oct 2024 13:11:36 -0600	[thread overview]
Message-ID: <532edd71-93c3-4d90-ac98-9763993807fa@linuxfoundation.org> (raw)
In-Reply-To: <20241004150849.70883-1-advaitdhamorikar@gmail.com>

On 10/4/24 09:08, Advait Dhamorikar wrote:
> atmel_hlcdc_plane_update_buffers: may use an uninitialized
> sr variable when the if condition remains unsatisfied
> 

As mentioned in my response to another one of your patches,
include how you found the problem in the change log.

> Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
> ---
>   drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> index 4a7ba0918eca..4150c4d0b4f2 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
> @@ -559,7 +559,7 @@ static void atmel_hlcdc_plane_update_buffers(struct atmel_hlcdc_plane *plane,
>   	const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc;
>   	struct atmel_hlcdc_dc *dc = plane->base.dev->dev_private;
>   	struct drm_framebuffer *fb = state->base.fb;
> -	u32 sr;
> +	u32 sr = 0;
  
>   	int i;
>   
>   	if (!dc->desc->is_xlcdc)

sr could be used uninitialized in the for loop, !dc->desc->is_xlcdc
case. However, is 0 the right initialization for this value?

thanks,
-- Shuah

  reply	other threads:[~2024-10-04 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 15:08 Advait Dhamorikar
2024-10-04 19:11 ` Shuah Khan [this message]
2024-10-07  3:13   ` Manikandan.M

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=532edd71-93c3-4d90-ac98-9763993807fa@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=advaitdhamorikar@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=anupnewsmail@gmail.com \
    --cc=bbrezillon@kernel.org \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=sam@ravnborg.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®