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: Make counter allocation drm managed Date: Mon, 25 May 2026 17:57:40 +1000 Message-ID: In-Reply-To: <20260523050212.557292-3-raag.jadav@intel.com> References: <20260523050212.557292-1-raag.jadav@intel.com> <20260523050212.557292-3-raag.jadav@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 **Verdict: Correct, minimal change.** Switching from `kcalloc` to `drmm_kcalloc` for counter allocation: ```c - counter =3D kcalloc(DRM_XE_RAS_ERR_COMP_MAX, sizeof(*counter), GFP_KERNEL= ); + counter =3D drmm_kcalloc(&xe->drm, DRM_XE_RAS_ERR_COMP_MAX, sizeof(*count= er), GFP_KERNEL); ``` And removing the corresponding manual free: ```c - kfree(ras->info[severity]); ras->info[severity] =3D NULL; ``` This ensures counter memory is freed during DRM device teardown regardless = of which error path is taken. The original code's `cleanup_node_param()` wa= s the only caller of `kfree(ras->info[severity])`, and that function wasn't= always reached on unwind =E2=80=94 exactly the bug described in the commit= message. The `ras->info[severity] =3D NULL` is correctly retained to clear the dangl= ing pointer. No issues. --- Generated by Claude Code Patch Reviewer