LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Robert Foss <robert.foss@linaro.org>
To: Neil Armstrong <narmstrong@baylibre.com>
Cc: Paul Cercueil <paul@crapouillou.net>, Phong LE <ple@baylibre.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	list@opendingux.net, dri-devel <dri-devel@lists.freedesktop.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] drm/bridge: it66121: Initialize {device,vendor}_ids
Date: Tue, 31 Aug 2021 16:22:44 +0200	[thread overview]
Message-ID: <CAG3jFytAdkt5DDzsm9T+buAL0vqS-X4M66aNyOaB8=5N3CbKWg@mail.gmail.com> (raw)
In-Reply-To: <27e68baf-5797-9c66-37b2-382cb8792467@baylibre.com>

On Mon, 30 Aug 2021 at 11:40, Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> On 27/08/2021 18:39, Paul Cercueil wrote:
> > These two arrays are populated with data read from the I2C device
> > through regmap_read(), and the data is then compared with hardcoded
> > vendor/product ID values of supported chips.
> >
> > However, the return value of regmap_read() was never checked. This is
> > fine, as long as the two arrays are zero-initialized, so that we don't
> > compare the vendor/product IDs against whatever garbage is left on the
> > stack.
> >
> > Address this issue by zero-initializing these two arrays.
> >
>
> Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver")
>
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > ---
> >  drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> > index 2f2a09adb4bc..b130d01147c6 100644
> > --- a/drivers/gpu/drm/bridge/ite-it66121.c
> > +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> > @@ -889,7 +889,7 @@ static irqreturn_t it66121_irq_threaded_handler(int irq, void *dev_id)
> >  static int it66121_probe(struct i2c_client *client,
> >                        const struct i2c_device_id *id)
> >  {
> > -     u32 vendor_ids[2], device_ids[2], revision_id;
> > +     u32 revision_id, vendor_ids[2] = { 0 }, device_ids[2] = { 0 };
> >       struct device_node *ep;
> >       int ret;
> >       struct it66121_ctx *ctx;
> >
>
> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

Applied series to drm-misc-next.

      reply	other threads:[~2021-08-31 14:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 16:39 Paul Cercueil
2021-08-27 16:39 ` [PATCH 2/2] drm/bridge: it66121: Wait for next bridge to be probed Paul Cercueil
2021-08-30  9:40   ` Neil Armstrong
2021-08-30  9:40 ` [PATCH 1/2] drm/bridge: it66121: Initialize {device,vendor}_ids Neil Armstrong
2021-08-31 14:22   ` Robert Foss [this message]

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='CAG3jFytAdkt5DDzsm9T+buAL0vqS-X4M66aNyOaB8=5N3CbKWg@mail.gmail.com' \
    --to=robert.foss@linaro.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=list@opendingux.net \
    --cc=narmstrong@baylibre.com \
    --cc=paul@crapouillou.net \
    --cc=ple@baylibre.com \
    --subject='Re: [PATCH 1/2] drm/bridge: it66121: Initialize {device,vendor}_ids' \
    /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

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).