mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 14:43:16 +00:00
platform/x86: compal-laptop: Initialize "value" in ec_read_u8()
In function ec_read_u8(), variable "value" could be uninitialized if ec_read() fails. However, "value" is returned directly and used in its callers. This is potentially unsafe. Signed-off-by: Yizhuo <yzhai003@ucr.edu> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
37d960a4d7
commit
09e7f2805c
@ -226,7 +226,7 @@ static const unsigned char pwm_lookup_table[256] = {
|
|||||||
/* General access */
|
/* General access */
|
||||||
static u8 ec_read_u8(u8 addr)
|
static u8 ec_read_u8(u8 addr)
|
||||||
{
|
{
|
||||||
u8 value;
|
u8 value = 0;
|
||||||
ec_read(addr, &value);
|
ec_read(addr, &value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user