Claude review: drm: rcar-du: Fix crash when no CMM is available

Claude Code Review Bot
2026-04-12T02:28:45Z

Patch Review

**Correctness: Good.** All three sites are correctly changed from `rcrtc->cmm->dev` to `rcrtc->cmm`. Looking at the initialization code at line 1302-1304:

```c
/* CMM might be disabled for this CRTC. */
if (rcdu->cmms[swindex].dev) {
rcrtc->cmm = &rcdu->cmms[swindex];
```

`rcrtc->cmm` is only set when the corresponding `cmms[].dev` is non-NULL, which means if `rcrtc->cmm` is non-NULL, then `rcrtc->cmm->dev` is guaranteed non-NULL. So testing `rcrtc->cmm` is both sufficient and correct — the two conditions are semantically equivalent when `cmm` is non-NULL, and only the new form is safe when `cmm` is NULL.

**Site 1 (line 516):** `rcar_du_cmm_setup()` — the early return guard. After the fix, `rcrtc->cmm->dev` is still used on line 522 in `rcar_cmm_setup(rcrtc->cmm->dev, &cmm_config)`, which is safe because the NULL check now correctly gates it.

**Site 2 (line 670):** `rcar_du_crtc_stop()` — guards the `rcar_cmm_disable(rcrtc->cmm->dev)` call on the next line. Correct.

**Site 3 (line 729):** `rcar_du_crtc_atomic_enable()` — guards the `rcar_cmm_enable(rcrtc->cmm->dev)` call. Correct.

**No issues found.** The commit message is clear, the Fixes tag correctly identifies the offending commit, it has a Tested-by from the reporter, and the fix is the minimal correct change. Good to merge.

---
Generated by Claude Code Patch Reviewer