]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm: rcar-du: Fix crash when no CMM is available
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 8 Apr 2026 12:42:05 +0000 (15:42 +0300)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Thu, 23 Apr 2026 12:53:46 +0000 (15:53 +0300)
commitf6c73e7156b54d8b9ddf1a27f4e93d3a1e49a73e
treeb2ba6dd817e9eb44b2bcfa5c6eefd6bccff88f8b
parentdc6d51959ec0c08366d5aaeb5b8fb02d814d1e4b
drm: rcar-du: Fix crash when no CMM is available

Commit 3bce3fdd1ff2 ("drm: rcar-du: Don't leak device_link to CMM")
refactored CMM handling, and introduced an incorrect test for CMM
availability. When no CMM is present, the rcrtc->cmm field is NULL,
testing rcrtc->cmm->dev causes a NULL pointer dereference. This slipped
through testing as all tests were run with the CMM present.

Fix this issue by correctly testing for rcrtc->cmm.

Fixes: 3bce3fdd1ff2 ("drm: rcar-du: Don't leak device_link to CMM")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/dri-devel/CAMuHMdXomz9GFDqkBjGX9Sda_GLccPcrihvFbOz0GAitDVNTbw@mail.gmail.com
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260408124205.1962448-1-laurent.pinchart+renesas@ideasonboard.com
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
(cherry picked from commit 3e9a1da270ddff449b1ad9eadc958f43bc204bd2)
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c