x86: zimage: Sanity-check the kernel version before printing it
authorSimon Glass <sjg@chromium.org>
Wed, 4 Nov 2020 16:59:14 +0000 (09:59 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 6 Nov 2020 01:51:34 +0000 (09:51 +0800)
commit7c79eddbec32d8258df701d95d8b432f9835110b
treeede22c32cfb03446f3a5858bae0532f747f9b5bc
parentb73d61a5565c3ab9e207a288186049806ce13e1b
x86: zimage: Sanity-check the kernel version before printing it

With Chrome OS the kernel setup block is stored in a separate place from
the kernel, so it is not possible to access the kernel version string.
At present, garbage is printed.

Add a sanity check to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/lib/zimage.c