lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 09/13] x86/microcode: Add a generic mechanism to declare support for minrev
Date
On Fri, 2022-10-14 at 13:09 -0700, Ashok Raj wrote:
> @@ -606,6 +606,7 @@ static ssize_t reload_store(struct device *dev,
>   enum ucode_state tmp_ret = UCODE_OK;
>   int bsp = boot_cpu_data.cpu_index;
>   unsigned long val;
> + int minrev;
>   ssize_t ret = 0;
>  
>   ret = kstrtoul(buf, 0, &val);
> @@ -621,8 +622,14 @@ static ssize_t reload_store(struct device *dev,
>   if (ret)
>   goto put;
>  
> - pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
> - pr_err("You should switch to early loading, if possible.\n");
> + if (microcode_ops->check_minrev())
> + minrev = microcode_ops->check_minrev();
> +
> + if (!minrev) {
> + pr_err("Attempting late microcode loading - it is dangerous and taints the kernel.\n");
> + pr_err("You should switch to early loading, if possible.\n");
> + }
> +

Hi Ashok,

IIUC a variable in stack isn't initialized to 0 automatically. So looks if
check_minrev() callback is NULL, you will get an uninitialized 'minrev' in the
above if() statement check.

--
Thanks,
-Kai


\
 
 \ /
  Last update: 2022-10-19 06:04    [W:0.123 / U:2.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site