]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mce: Fix use of uninitialized MCE message string
authorJan H. Schönherr <jschoenh@amazon.de>
Fri, 3 Jan 2020 15:07:19 +0000 (16:07 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 13 Jan 2020 09:07:56 +0000 (10:07 +0100)
commit3d7c92c0eac6aab7ab1583f92b1e5b7b8f84a12f
treec9192fe6916f390f0a216d760a5fffeb3cefb9cb
parent52daf8e8e9063037a6aa325b1ed4dc01df63f3d0
x86/mce: Fix use of uninitialized MCE message string

The function mce_severity() is not required to update its msg argument.
In fact, mce_severity_amd() does not, which makes mce_no_way_out()
return uninitialized data, which may be used later for printing.

Assuming that implementations of mce_severity() either always or never
update the msg argument (which is currently the case), it is sufficient
to initialize the temporary variable in mce_no_way_out().

While at it, avoid printing a useless "Unknown".

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200103150722.20313-4-jschoenh@amazon.de
arch/x86/kernel/cpu/mce/core.c