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/xe/drm_ras: Wire up error threshold callbacks Date: Sat, 16 May 2026 12:54:51 +1000 Message-ID: In-Reply-To: <20260512191610.1817578-8-raag.jadav@intel.com> References: <20260512191610.1817578-1-raag.jadav@intel.com> <20260512191610.1817578-8-raag.jadav@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Wires the threshold callbacks to the drm_ras node for correctable errors only (not uncorrectable). This makes sense since thresholds control when hardware raises correctable errors to software. **Issue: Missing NULL check on `info[error_id].name` in `query_correctable_error_threshold`.** ```c static int query_correctable_error_threshold(struct drm_ras_node *ep, u32 error_id, const char **name, u32 *val) { ... *name = info[error_id].name; return xe_ras_get_threshold(xe, DRM_XE_RAS_ERR_SEV_CORRECTABLE, error_id, val); } ``` Compare with `hw_query_error_counter()` which checks `if (!info || !info[error_id].name) return -ENOENT;`. Here, if `info[error_id].name` is NULL (which it will be for `error_id == 0` since the enum starts at 1), the caller receives a NULL `name` pointer. The drm_ras core's `msg_reply_threshold_value()` will then pass NULL to `nla_put_string()`, which will likely crash. The `info` pointer itself also lacks a NULL check, although `assign_node_params` ensures it's allocated before the callback is set. **Minor: `set_correctable_error_threshold` doesn't validate the error_id against the counter info.** The correctable counter query does validate (indirectly via `hw_query_error_counter`'s name check), but the set path passes `error_id` straight through without verifying the component is actually present. The drm_ras core does range check, but components can be non-contiguous (per the drm_ras callback doc about `-ENOENT` for skipped entries). --- --- Generated by Claude Code Patch Reviewer