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/ethosu: fix wrong weight index in NPU_SET_SCALE1_LENGTH on U85 Date: Mon, 25 May 2026 17:19:40 +1000 Message-ID: In-Reply-To: <20260523210840.92039-3-meatuni001@gmail.com> References: <20260523210840.92039-1-meatuni001@gmail.com> <20260523210840.92039-3-meatuni001@gmail.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 **Verdict: Correct, obvious typo/copy-paste fix.** The change at line 601 (pre-patch): ```c case NPU_SET_SCALE1_LENGTH: // NPU_SET_WEIGHT2_LENGTH (U85) if (ethosu_is_u65(edev)) st.scale[1].length =3D cmds[1]; else st.weight[1].length =3D cmds[1]; // BUG: should be weight[2] ``` Fixed to: ```c else st.weight[2].length =3D cmds[1]; ``` This is unambiguously correct. The opcode `0x4093` is `NPU_SET_WEIGHT2_LENG= TH` on non-U65 hardware (confirmed in `ethosu_device.h:148`). The BASE hand= ler for the same opcode at line 591-596 correctly writes to `st.weight[2].b= ase`, so the LENGTH handler must match with `st.weight[2].length`. The orig= inal code wrote to `weight[1]`, which is handled by the separate `NPU_SET_W= EIGHT1_LENGTH` case at line 588-589 =E2=80=94 so the bug both corrupted `we= ight[1].length` and left `weight[2].length` at its sentinel value of `0xfff= fffff`, breaking bounds checks for two weight buffers simultaneously. The Fixes tag and Cc: stable are appropriate for both patches. --- Generated by Claude Code Patch Reviewer