From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: accel/qaic: fix incorrect counter check in RAS message decode
Date: Sun, 12 Apr 2026 09:40:28 +1000 [thread overview]
Message-ID: <review-patch1-20260410112015.592546-1-alok.a.tiwari@oracle.com> (raw)
In-Reply-To: <20260410112015.592546-1-alok.a.tiwari@oracle.com>
Patch Review
**Status: Looks good / Correct fix**
The bug is in `decode_ras_msg()` at `drivers/accel/qaic/qaic_ras.c:500,504`. The switch statement handles three RAS error types — `CE`, `UE`, and `UE_NF` — and each case should check its own counter against `UINT_MAX` before incrementing to prevent overflow. However, the `UE` and `UE_NF` cases both incorrectly check `ce_count`:
```c
case UE:
if (qdev->ce_count != UINT_MAX) // BUG: should be ue_count
qdev->ue_count++;
break;
case UE_NF:
if (qdev->ce_count != UINT_MAX) // BUG: should be ue_nf_count
qdev->ue_nf_count++;
break;
```
The fix correctly changes these to check the matching counter:
```c
case UE:
if (qdev->ue_count != UINT_MAX)
qdev->ue_count++;
break;
case UE_NF:
if (qdev->ue_nf_count != UINT_MAX)
qdev->ue_nf_count++;
break;
```
This is a textbook copy-paste error — the `CE` case was likely written first, and the guard condition was duplicated to `UE` and `UE_NF` without updating the variable name. The fix is minimal and obviously correct. The `Fixes:` tag is present and points to the commit that introduced the bug.
No concerns with this patch.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-11 23:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 11:20 [PATCH] accel/qaic: fix incorrect counter check in RAS message decode Alok Tiwari
2026-04-10 17:08 ` Jeff Hugo
2026-04-10 17:08 ` Jeff Hugo
2026-04-11 23:40 ` Claude Code Review Bot [this message]
2026-04-11 23:40 ` 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-patch1-20260410112015.592546-1-alok.a.tiwari@oracle.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