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: use krealloc_array to prevent integer overflow Date: Wed, 25 Mar 2026 07:53:36 +1000 Message-ID: In-Reply-To: <20260323120051.983301-1-baoli.zhang@linux.intel.com> References: <20260323120051.983301-1-baoli.zhang@linux.intel.com> <20260323120051.983301-1-baoli.zhang@linux.intel.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 **Correctness:** The transformation is mechanically correct in both hunks. = The arguments are split properly: the original `count * sizeof(u32)` become= s `count, sizeof(u32)`, and `max_vmas * sizeof(*madvise_range->vmas)` becom= es `max_vmas, sizeof(*madvise_range->vmas)`. **Commit message nit:** The subject says "prevent integer overflow" which s= lightly overstates the risk. Both call sites have values bounded well below= overflow thresholds. A more accurate subject would be something like "use = krealloc_array to guard against potential integer overflow" or "use kreallo= c_array for overflow-safe allocation". This is a minor style point. **Signed-off-by ordering:** The patch has: ``` Signed-off-by: Baoli.Zhang Signed-off-by: Junxiao.Chang ``` The `From:` header shows Baoli.Zhang as the author, so Junxiao.Chang's Sign= ed-off-by appearing second (after the author) implies Junxiao.Chang is forw= arding the patch. If Junxiao.Chang is a co-developer rather than a submitte= r in the chain, a `Co-developed-by:` + `Signed-off-by:` pair would be more = appropriate. **xe_vm_madvise.c alignment:** The alignment of the continuation arguments = is slightly off from the opening parenthesis convention: ```c __vmas =3D krealloc_array(madvise_range->vmas, max_vmas, sizeof(*madvise_range->vmas), GFP_KERNEL); ``` The arguments after the first line are indented with tabs+spaces to roughly= column-align, but they don't align with the first argument after the openi= ng `(`. This is a minor style issue =E2=80=94 matching the existing indenta= tion style of the surrounding code is fine. **Overall:** A straightforward and correct cleanup patch. No functional con= cerns. Recommend accepting with optional minor commit message adjustment. --- Generated by Claude Code Patch Reviewer