From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/nouveau: handle nouveau_hw_get_clock() return value
Date: Sat, 16 May 2026 10:30:37 +1000 [thread overview]
Message-ID: <review-overall-20260514174008.4515-1-ms.bulatov7@gmail.com> (raw)
In-Reply-To: <20260514174008.4515-1-ms.bulatov7@gmail.com>
Overall Series Review
Subject: drm/nouveau: handle nouveau_hw_get_clock() return value
Author: Bulatov Mark <ms.bulatov7@gmail.com>
Patches: 1
Reviewed: 2026-05-16T10:30:37.685317
---
This is a single-patch series addressing a potential division-by-zero in the nouveau NV04 display arbitration code. The problem is real: `nouveau_hw_get_clock()` can return 0 (when `nouveau_hw_pllvals_to_clk()` gets zero M1/M2 divisors) or a negative error code (when `nouveau_hw_get_pllvals()` fails with `-ENOENT`). These values are then used as divisors throughout `nv04_calc_arb()` and `nv10_calc_arb()`, so the defensive check is warranted.
However, the fix has a significant problem: it introduces a **silent early return that leaves the caller's output parameters (`*burst` and `*lwm`) uninitialized**. The caller in `crtc.c:893` declares `arb_burst` and `arb_lwm` as bare `int` locals (line 848) without initialization, then immediately writes them to CRTC registers after the call. A silent return turns a division-by-zero into use-of-uninitialized-stack-data written to hardware registers — arguably trading one bug for another.
**Verdict: Needs revision.** The issue being fixed is real, but the fix needs to either (a) initialize the output parameters to safe defaults before returning, or (b) propagate an error code so the caller can skip the register writes.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 0:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 17:40 [PATCH] drm/nouveau: handle nouveau_hw_get_clock() return value Bulatov Mark
2026-05-16 0:30 ` Claude Code Review Bot [this message]
2026-05-16 0:30 ` Claude review: " Claude Code Review Bot
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-20260514174008.4515-1-ms.bulatov7@gmail.com \
--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