[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6fd4-64ecbf00-7-213b7840@157890373>
Date: Mon, 28 Aug 2023 16:35:36 +0100
From: "Helen Mae Koike Fornazier" <helen.koike@...labora.com>
To: "Jai Luthra" <j-luthra@...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>, nm@...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
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>
> ---
> 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>
>
Powered by blists - more mailing lists