All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..." <alsa-devel@alsa-project.org>,
	patches@opensource.cirrus.com,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] pinctrl: madera: Fix uninitialized variable bug in madera_mux_set_mux
Date: Thu, 11 Oct 2018 10:40:08 +0200	[thread overview]
Message-ID: <CACRpkda8Fo6ubO9XuDXC9tcLWPNp_6TMf6-g9DUxdU6JXa0Veg@mail.gmail.com> (raw)
In-Reply-To: <20181010151313.GA16854@embeddedor.com>

On Wed, Oct 10, 2018 at 5:13 PM Gustavo A. R. Silva
<gustavo@embeddedor.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@embeddedor.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

  parent reply	other threads:[~2018-10-11  8:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 15:13 [PATCH v2] pinctrl: madera: Fix uninitialized variable bug in madera_mux_set_mux Gustavo A. R. Silva
2018-10-10 16:08 ` Charles Keepax
2018-10-10 16:08   ` Charles Keepax
2018-10-11  8:40 ` Linus Walleij [this message]
2018-10-11  8:40   ` Linus Walleij
2018-10-12  9:04   ` Gustavo A. R. Silva
2018-10-12  9:04     ` Gustavo A. R. Silva

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=CACRpkda8Fo6ubO9XuDXC9tcLWPNp_6TMf6-g9DUxdU6JXa0Veg@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=gustavo@embeddedor.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.