Message ID | CAPM=9txd-x1NKWK9BBqVTDNOR00zNqcXgs76YJrDfL94eMLYqQ@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [git,pull] drm for 5.12-rc1 | expand |
The pull request you sent on Fri, 19 Feb 2021 16:06:19 +1000:
> git://anongit.freedesktop.org/drm/drm tags/drm-next-2021-02-19
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/d99676af540c2dc829999928fb81c58c80a1dce4
Thank you!
On Thu, Feb 18, 2021 at 10:06 PM Dave Airlie <airlied@gmail.com> wrote: > > Let me know if there are any issues, gcc was happy, and I obviously already pushed out my merge, but then when I did my clang build afterwards, it reports: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning: variable 'structure_size' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:770:23: note: uninitialized use occurs here memset(header, 0xFF, structure_size); ^~~~~~~~~~~~~~ and clang is very very right. That "default" case is completely broken, and will generate a randomly sized memset. Not good. Presumably that default case never happens, but if so it shouldn't exist. Perhaps better yet, make the "default" case just do a "return" instead of a break. Breaking out of the switch statement to code that cannot possibly work is all kinds of mindless. Kevin/Alex? This was introduced by commit de4b7cd8cb87 ("drm/amd/pm/swsmu: unify the init soft gpu metrics function") Linus
On Sun, Feb 21, 2021 at 03:07:17PM -0800, Linus Torvalds wrote: > On Thu, Feb 18, 2021 at 10:06 PM Dave Airlie <airlied@gmail.com> wrote: > > > > Let me know if there are any issues, > > gcc was happy, and I obviously already pushed out my merge, but then > when I did my clang build afterwards, it reports: > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning: > variable 'structure_size' is used uninitialized whenever switch > default is taken [-Wsometimes-uninitialized] > default: > ^~~~~~~ > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:770:23: note: > uninitialized use occurs here > memset(header, 0xFF, structure_size); > ^~~~~~~~~~~~~~ > > and clang is very very right. That "default" case is completely > broken, and will generate a randomly sized memset. Not good. > > Presumably that default case never happens, but if so it shouldn't exist. > > Perhaps better yet, make the "default" case just do a "return" instead > of a break. Breaking out of the switch statement to code that cannot > possibly work is all kinds of mindless. > > Kevin/Alex? This was introduced by commit de4b7cd8cb87 > ("drm/amd/pm/swsmu: unify the init soft gpu metrics function") > > Linus I sent https://lore.kernel.org/r/20210218224849.5591-1-nathan@kernel.org/ a few days ago and Kevin reviewed it, just seems like Alex needs to pick it up. Cheers, Nathan
On Sun, Feb 21, 2021 at 6:45 PM Nathan Chancellor <nathan@kernel.org> wrote: > > On Sun, Feb 21, 2021 at 03:07:17PM -0800, Linus Torvalds wrote: > > On Thu, Feb 18, 2021 at 10:06 PM Dave Airlie <airlied@gmail.com> wrote: > > > > > > Let me know if there are any issues, > > > > gcc was happy, and I obviously already pushed out my merge, but then > > when I did my clang build afterwards, it reports: > > > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning: > > variable 'structure_size' is used uninitialized whenever switch > > default is taken [-Wsometimes-uninitialized] > > default: > > ^~~~~~~ > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:770:23: note: > > uninitialized use occurs here > > memset(header, 0xFF, structure_size); > > ^~~~~~~~~~~~~~ > > > > and clang is very very right. That "default" case is completely > > broken, and will generate a randomly sized memset. Not good. > > > > Presumably that default case never happens, but if so it shouldn't exist. > > > > Perhaps better yet, make the "default" case just do a "return" instead > > of a break. Breaking out of the switch statement to code that cannot > > possibly work is all kinds of mindless. > > > > Kevin/Alex? This was introduced by commit de4b7cd8cb87 > > ("drm/amd/pm/swsmu: unify the init soft gpu metrics function") > > > > Linus > > I sent https://lore.kernel.org/r/20210218224849.5591-1-nathan@kernel.org/ > a few days ago and Kevin reviewed it, just seems like Alex needs to pick > it up. Yeah, sorry, I meant to include it, but it slipped through the cracks last week. Will include it in my -fixes PR this week. Alex