diff options
author | Tom Rix <[email protected]> | 2020-08-20 06:19:32 -0700 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2020-08-21 11:32:34 -0700 |
commit | cecf7560f00a8419396a2ed0f6e5d245ccb4feac (patch) | |
tree | 4ea85106d15e6de790e06c027528a0c646c33f27 /drivers/usb/cdns3 | |
parent | 8aebbbb2d573d0b4afc08b90ac7d73dba2d9da97 (diff) |
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 <[email protected]>
Reviewed-by: Henrik Rydberg <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3')
0 files changed, 0 insertions, 0 deletions