[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ljopjy4gjuduyjq6auhwi3jinblqagf6vghgvw3edfmj6tyerw@q2kglcng3glf>
Date: Fri, 1 Sep 2023 14:36:27 +0530
From: Jai Luthra <j-luthra@...com>
To: Nishanth Menon <nm@...com>,
Helen Mae Koike Fornazier <helen.koike@...labora.com>
CC: Phong LE <ple@...libre.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Nicolas Belin <nbelin@...libre.com>,
"Andy.Hsieh" <Andy.Hsieh@...iatek.com>,
Aradhya Bhatia <a-bhatia1@...com>, <devarsht@...com>,
<linux-kernel@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] drm: bridge: it66121: Fix invalid connector dereference
Hi Nishanth, Helen,
Thanks for the review.
On Aug 31, 2023 at 07:25:31 -0500, Nishanth Menon wrote:
> On 16:35-20230828, Helen Mae Koike Fornazier wrote:
> > On Friday, August 25, 2023 08:02 -03, Jai Luthra <j-luthra@...com> wrote:
> >
> > > Fix the NULL pointer dereference when no monitor is connected, and the
> > > sound card is opened from userspace.
> > >
> > > Instead return an error as EDID information cannot be provided to
> > > the sound framework if there is no connector attached.
> > >
> > > Fixes: e0fd83dbe924 ("drm: bridge: it66121: Add audio support")
> > > Reported-by: Nishanth Menon <nm@...com>
> > > Closes: https://lore.kernel.org/all/20230825105849.crhon42qndxqif4i@gondola/
> > > Signed-off-by: Jai Luthra <j-luthra@...com>
> >
> > Reviewed-by: Helen Koike <helen.koike@...labora.com>
>
>
> Occurs on today's master: v6.5-8894-gb97d64c72259
> https://gist.github.com/nmenon/6c7166171729342ee0be7de90b65c5c6#file-v6-5-8894-gb97d64c72259-L821
>
> My only complaint with the patch is - yes, it does'nt crash, but I see
> this spam on my console:
> https://gist.github.com/nmenon/6c7166171729342ee0be7de90b65c5c6#file-with-patch-on-top-L236
>
Aradhya suggested an alternative approach [1] used by some bridges,
where we return a buffer of 0s instead of an error here.
That will fix the spam, but more importantly will also allow playback if
the HDMI monitor is hot-plugged later (after probe). I will send a new
revision of this patch that uses that approach.
[1] https://lore.kernel.org/dri-devel/d2deac24-d5ab-e1c4-81c5-4874c2f5ea07@ti.com/
>
> >
> > > ---
> > > drivers/gpu/drm/bridge/ite-it66121.c | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> > > index 466641c77fe9..d6fa00dea464 100644
> > > --- a/drivers/gpu/drm/bridge/ite-it66121.c
> > > +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> > > @@ -1446,6 +1446,11 @@ static int it66121_audio_get_eld(struct device *dev, void *data,
> > > {
> > > struct it66121_ctx *ctx = dev_get_drvdata(dev);
> > >
> > > + if (!ctx->connector) {
> > > + dev_dbg(dev, "No connector present, cannot provide EDID data");
> > > + return -EINVAL;
> > > + }
> > > +
> > > mutex_lock(&ctx->lock);
> > >
> > > memcpy(buf, ctx->connector->eld,
> > >
> > > ---
> > > base-commit: 6269320850097903b30be8f07a5c61d9f7592393
> > > change-id: 20230825-it66121_edid-6ee98517808b
> > >
> > > Best regards,
> > > --
> > > Jai Luthra <j-luthra@...com>
> > >
> >
>
> --
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
--
Thanks,
Jai
GPG Fingerprint: 4DE0 D818 E5D5 75E8 D45A AFC5 43DE 91F9 249A 7145
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists