linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: SurajSonawane2415 <surajsonawane0215@gmail.com>
Cc: pavel@ucw.cz, matthias.bgg@gmail.com,
	angelogioacchino.delregno@collabora.com,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Date: Fri, 11 Oct 2024 08:47:02 +0100	[thread overview]
Message-ID: <20241011074702.GN661995@google.com> (raw)
In-Reply-To: <20241006131337.48442-1-surajsonawane0215@gmail.com>

On Sun, 06 Oct 2024, SurajSonawane2415 wrote:

> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
> to resolve the following warning:
> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
> error: uninitialized symbol 'ret'.
> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
> access.
> 
> Signed-off-by: SurajSonawane2415 <surajsonawane0215@gmail.com>

Real names only.  Please update your .gitconfig.

> ---
>  drivers/leds/rgb/leds-mt6370-rgb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/rgb/leds-mt6370-rgb.c b/drivers/leds/rgb/leds-mt6370-rgb.c
> index 10a0b5b45..87805c21e 100644
> --- a/drivers/leds/rgb/leds-mt6370-rgb.c
> +++ b/drivers/leds/rgb/leds-mt6370-rgb.c
> @@ -587,7 +587,7 @@ static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
>  	struct mt6370_led *led = container_of(mccdev, struct mt6370_led, mc);
>  	struct mt6370_priv *priv = led->priv;
>  	struct mc_subled *subled;
> -	int i, ret;
> +	int i, ret = 0;
>  
>  	mutex_lock(&led->priv->lock);
>  
> -- 
> 2.34.1
> 

-- 
Lee Jones [李琼斯]


  reply	other threads:[~2024-10-11  7:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06 13:13 [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear SurajSonawane2415
2024-10-11  7:47 ` Lee Jones [this message]
2024-10-11 13:20   ` Suraj Sonawane
2024-10-11  9:09 ` (subset) " Lee Jones
2024-10-11 13:22   ` Suraj Sonawane
2024-10-15  8:58     ` Lee Jones
2024-10-16  4:21       ` [PATCH v2] " Suraj Sonawane
2024-10-16  7:53         ` (subset) " Lee Jones
2024-10-16 12:13           ` Suraj Sonawane
2024-10-16  4:25       ` (subset) [PATCH] " Suraj Sonawane

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=20241011074702.GN661995@google.com \
    --to=lee@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=surajsonawane0215@gmail.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;
as well as URLs for NNTP newsgroup(s).