From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: [PATCH] drm/amd/display: Fix uninitialized variable which breaks full LTO Date: Fri, 13 Mar 2026 13:56:29 +1000 Message-ID: In-Reply-To: References: X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Bug analysis is correct.** Looking at the current source (`amdgpu_dm.c`): - Line 2570: `memset(&fw_meta_info_params, 0, ...)` =E2=80=94 zeroed here - Line 2574: `fw_meta_info_params.bss_data_size =3D le32_to_cpu(hdr->bss_da= ta_bytes);` =E2=80=94 populated here =20 - Line 2578: `fw_meta_info_params.fw_bss_data =3D region_params.bss_data_si= ze ? ...` =E2=80=94 **BUG**: reads uninitialized `region_params` - Line 2591: `memset(®ion_params, 0, ...)` =E2=80=94 `region_params` onl= y zeroed *after* the buggy use **The fix is correct:** ```diff - fw_meta_info_params.fw_bss_data =3D region_params.bss_data_size ? adev->d= m.dmub_fw->data + + fw_meta_info_params.fw_bss_data =3D fw_meta_info_params.bss_data_size ? a= dev->dm.dmub_fw->data + ``` This changes the condition to read from `fw_meta_info_params.bss_data_size`= which holds the same value (`le32_to_cpu(hdr->bss_data_bytes)`) and is alr= eady initialized. After the fix, `region_params.bss_data_size` is later set= from `fw_meta_info_params.bss_data_size` at line 2594, so the data flow is= consistent. **Minor observations:** - The v2 improvement (using `fw_meta_info_params.bss_data_size` rather than= re-reading from the header) is the cleaner approach, as Nathan suggested. - It's noteworthy that without LTO, the uninitialized stack variable appare= ntly happened to be zero or non-zero in a way that matched the correct beha= vior =E2=80=94 classic undefined behavior that "works" by accident until op= timization settings change. - The Fixes tag correctly identifies the commit that introduced the bug. **No issues found.** This is a clean, correct one-line fix. --- Generated by Claude Code Patch Reviewer