From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/gud: fix NULL crtc dereference on display disable
Date: Mon, 23 Feb 2026 05:53:49 +1000 [thread overview]
Message-ID: <review-overall-20260222054551.80864-1-me@shenghaoyang.info> (raw)
In-Reply-To: <20260222054551.80864-1-me@shenghaoyang.info>
Overall Series Review
Subject: drm/gud: fix NULL crtc dereference on display disable
Author: Shenghao Yang <me@shenghaoyang.info>
Patches: 1
Reviewed: 2026-02-23T05:53:49.308471
---
This is a single-patch fix for a NULL pointer dereference in the GUD (Generic USB Display) driver's `gud_plane_atomic_update()` function. When a display is disabled through normal desktop environment paths (as opposed to USB hotplug), `new_state->crtc` is NULL, and the function proceeds to dereference it after the `drm_dev_enter()` check (which only guards against USB disconnect). The crash was reported by the kernel test robot and Dan Carpenter.
The fix takes the correct architectural approach: instead of adding more NULL checks inline, it refactors the crtc enable/disable logic out of the plane update function and into proper `atomic_enable`/`atomic_disable` CRTC helper callbacks. This delegates the crtc state transitions to the DRM atomic helpers, which is the standard pattern for DRM drivers. The switch to `drm_atomic_helper_commit_tail_rpm` ensures correct ordering (crtc enables before plane updates) and uses `DRM_PLANE_COMMIT_ACTIVE_ONLY` so planes on inactive CRTCs are not flushed.
The patch introduces some behavioral changes compared to the old code: on mode changes, a full disable/re-enable cycle is performed (the old code only sent `SET_STATE_COMMIT` inline), and `SET_STATE_COMMIT` is now sent unconditionally on crtc enable. These are documented in the v5 changelog and appear to be intentional simplifications that the GUD protocol should tolerate. The patch is well-structured and correct.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-02-22 19:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-22 5:45 [PATCH v5] drm/gud: fix NULL crtc dereference on display disable Shenghao Yang
2026-02-22 19:53 ` Claude review: " Claude Code Review Bot
2026-02-22 19:53 ` Claude Code Review Bot [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=review-overall-20260222054551.80864-1-me@shenghaoyang.info \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox