[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABvMjLTicqk-ncY18j=UCZhCCugTVkPWKjkWZj9yEccUp3m8XQ@mail.gmail.com>
Date: Thu, 3 Oct 2019 21:21:44 -0700
From: Yizhuo Zhai <yzhai003@....edu>
To: Sebastian Reichel <sre@...nel.org>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, Zhiyun Qian <zhiyunq@...ucr.edu>,
Chengyu Song <csong@...ucr.edu>
Subject: Potential uninitialized variables in power: supply: rt5033_battery:
Hi:
drivers/power/supply/rt5033_battery.c:
In function rt5033_battery_get_present(), variable "val" could be
uninitialized if regmap_read() returns -EINVAL. However, "val" is
used to decide the return value, which is potentially unsafe.
Also, we cannot simply return -EINVAL in rt5033_battery_get_present()
because it's not an acceptable return value.
Thanks for your time to check this case.
--
Kind Regards,
Yizhuo Zhai
Computer Science, Graduate Student
University of California, Riverside
Powered by blists - more mailing lists