From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260410112015.592546-1-alok.a.tiwari@oracle.com> References: <20260410112015.592546-1-alok.a.tiwari@oracle.com> <20260410112015.592546-1-alok.a.tiwari@oracle.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 =E2=80=94 `CE`, `UE`, = and `UE_NF` =E2=80=94 and each case should check its own counter against `U= INT_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 !=3D UINT_MAX) // BUG: should be ue_count qdev->ue_count++; break; case UE_NF: if (qdev->ce_count !=3D 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 !=3D UINT_MAX) qdev->ue_count++; break; case UE_NF: if (qdev->ue_nf_count !=3D UINT_MAX) qdev->ue_nf_count++; break; ``` This is a textbook copy-paste error =E2=80=94 the `CE` case was likely writ= ten first, and the guard condition was duplicated to `UE` and `UE_NF` witho= ut updating the variable name. The fix is minimal and obviously correct. Th= e `Fixes:` tag is present and points to the commit that introduced the bug. No concerns with this patch. --- Generated by Claude Code Patch Reviewer