[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkda8Fo6ubO9XuDXC9tcLWPNp_6TMf6-g9DUxdU6JXa0Veg@mail.gmail.com>
Date: Thu, 11 Oct 2018 10:40:08 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: Charles Keepax <ckeepax@...nsource.cirrus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..."
<alsa-devel@...a-project.org>, patches@...nsource.cirrus.com,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] pinctrl: madera: Fix uninitialized variable bug in madera_mux_set_mux
On Wed, Oct 10, 2018 at 5:13 PM Gustavo A. R. Silva
<gustavo@...eddedor.com> wrote:
> There is a potential execution path in which variable *ret* is checked
> in an IF statement, and then its value is used to report an error at
> line 659 without being properly initialized previously:
>
> 659 if (ret)
> 660 dev_err(priv->dev, "Failed to write to 0x%x (%d)\n", reg, ret);
>
> Fix this by initializing variable *ret* to 0 in order to
> avoid unpredictable or unintended results.
>
> Addresses-Coverity-ID: 1471969 ("Uninitialized scalar variable")
> Fixes: 218d72a77b0b ("pinctrl: madera: Add driver for Cirrus Logic Madera codecs")
> Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>
> ---
> Changes in v2:
> - Initialize variable ret to 0 instead of -1. Thanks to Charles Keepax
> for pointing this out.
> - Update subject and commit log.
Patch applied with Charles' ACK.
Yours,
Linus Walleij
Powered by blists - more mailing lists