aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2020-08-20 06:19:32 -0700
committerGuenter Roeck <linux@roeck-us.net>2020-08-21 11:32:34 -0700
commitcecf7560f00a8419396a2ed0f6e5d245ccb4feac (patch)
tree4ea85106d15e6de790e06c027528a0c646c33f27 /include/xen
parenthwmon: (nct7904) Correct divide by 0 (diff)
downloadlinux-dev-cecf7560f00a8419396a2ed0f6e5d245ccb4feac.tar.xz
linux-dev-cecf7560f00a8419396a2ed0f6e5d245ccb4feac.zip
hwmon: (applesmc) check status earlier.
clang static analysis reports this representative problem applesmc.c:758:10: warning: 1st function call argument is an uninitialized value left = be16_to_cpu(*(__be16 *)(buffer + 6)) >> 2; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ buffer is filled by the earlier call ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, ... This problem is reported because a goto skips the status check. Other similar problems use data from applesmc_read_key before checking the status. So move the checks to before the use. Signed-off-by: Tom Rix <trix@redhat.com> Reviewed-by: Henrik Rydberg <rydberg@bitmath.org> Link: https://lore.kernel.org/r/20200820131932.10590-1-trix@redhat.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/xen')
0 files changed, 0 insertions, 0 deletions