Patch "drm: bridge: it66121: Fix invalid connector dereference" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm: bridge: it66121: Fix invalid connector dereference

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-bridge-it66121-fix-invalid-connector-dereference.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c23bed494c793778ab771eef424b5f6c92c6702a
Author: Jai Luthra <j-luthra@xxxxxx>
Date:   Fri Sep 1 15:01:23 2023 +0530

    drm: bridge: it66121: Fix invalid connector dereference
    
    [ Upstream commit d0375f6858c4ff7244b62b02eb5e93428e1916cd ]
    
    Fix the NULL pointer dereference when no monitor is connected, and the
    sound card is opened from userspace.
    
    Instead return an empty buffer (of zeroes) as the EDID information to
    the sound framework if there is no connector attached.
    
    Fixes: e0fd83dbe924 ("drm: bridge: it66121: Add audio support")
    Reported-by: Nishanth Menon <nm@xxxxxx>
    Closes: https://lore.kernel.org/all/20230825105849.crhon42qndxqif4i@gondola/
    Reviewed-by: Helen Koike <helen.koike@xxxxxxxxxxxxx>
    Signed-off-by: Jai Luthra <j-luthra@xxxxxx>
    Tested-by: Nishanth Menon <nm@xxxxxx>
    Reviewed-by: Aradhya Bhatia <a-bhatia1@xxxxxx>
    Signed-off-by: Robert Foss <rfoss@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230901-it66121_edid-v2-1-aa59605336b9@xxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index 466641c77fe91..fc7f5ec5fb381 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -1447,10 +1447,14 @@ static int it66121_audio_get_eld(struct device *dev, void *data,
 	struct it66121_ctx *ctx = dev_get_drvdata(dev);
 
 	mutex_lock(&ctx->lock);
-
-	memcpy(buf, ctx->connector->eld,
-	       min(sizeof(ctx->connector->eld), len));
-
+	if (!ctx->connector) {
+		/* Pass en empty ELD if connector not available */
+		dev_dbg(dev, "No connector present, passing empty EDID data");
+		memset(buf, 0, len);
+	} else {
+		memcpy(buf, ctx->connector->eld,
+		       min(sizeof(ctx->connector->eld), len));
+	}
 	mutex_unlock(&ctx->lock);
 
 	return 0;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux