From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/i915/modeset: fix NULL/ctx handling in lock paths Date: Tue, 05 May 2026 11:50:03 +1000 Message-ID: In-Reply-To: <20260429060431.1462589-1-george.d.sworo@intel.com> References: <20260429060431.1462589-1-george.d.sworo@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/i915/modeset: fix NULL/ctx handling in lock paths Author: george.d.sworo@intel.com Patches: 6 Reviewed: 2026-05-05T11:50:03.943890 --- **NAK.** This series adds defensive NULL checks for `ctx` inside the static= helper `modeset_lock()`, but this function **can never be called with a NU= LL `ctx`** in the existing code. The two callers are: 1. `drm_modeset_lock()` (line 394) =E2=80=94 which already handles `ctx =3D= =3D NULL` at line 397 and only calls `modeset_lock()` when `ctx` is non-NUL= L. 2. `drm_modeset_backoff()` (line 360) =E2=80=94 which dereferences `ctx->co= ntended` before calling `modeset_lock()`, so `ctx` is necessarily non-NULL. The cover letter claims this is "seen in HDCP/MST paths" but provides no cr= ash log, stack trace, or reproducer. If there is genuinely a code path reac= hing this function with a NULL context, the correct fix is to fix the broke= n caller, not to silently paper over it in a core locking primitive. Adding= a silent fallback to plain `ww_mutex_lock(..., NULL)` would bypass deadloc= k detection and lock tracking (`ctx->locked` list), which would mask real b= ugs and cause worse problems downstream (e.g., `drm_modeset_drop_locks()` w= ouldn't know about the lock). The commit messages also claim `drm_modeset_drop_locks()` has the same prob= lem, but neither patch touches that function. --- Generated by Claude Code Patch Reviewer