[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84edfcd4-02f3-4cd0-90d8-eb5f3cdabec5@stanley.mountain>
Date: Tue, 8 Oct 2024 21:28:07 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Mark Brown <broonie@...nel.org>
Cc: Colin Ian King <colin.i.king@...il.com>,
Oder Chiou <oder_chiou@...ltek.com>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
Jack Yu <jack.yu@...ltek.com>, linux-sound@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] ASoC: rt-sdw-common: Fix bit-wise or'ing of values
into uninitialized variable ret
On Tue, Oct 08, 2024 at 06:04:08PM +0100, Mark Brown wrote:
> On Tue, Oct 08, 2024 at 05:47:07PM +0100, Colin Ian King wrote:
> > There are a handful of bit-wise or'ing of values into the uninitialized
> > variable ret resulting in garbage results. Fix this by ininitializing
> > ret to zero.
>
> I'm very disappinted in the compiler for not noticing this :(
We disabled GCC's uninitialized variable check years ago before we enabled
-Werror. Clang does catch this.
CC sound/soc/codecs/rt-sdw-common.o
sound/soc/codecs/rt-sdw-common.c:119:3: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
ret |= SND_JACK_BTN_2;
^~~
sound/soc/codecs/rt-sdw-common.c:111:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
regards,
dan carpenter
Powered by blists - more mailing lists