diff options
author | Javier Carrasco <[email protected]> | 2024-02-07 22:17:09 +0100 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2024-02-25 12:37:42 -0800 |
commit | efd49b8eef659e0aa962ec1dbf18740e34735219 (patch) | |
tree | 5802604b7183974842e030411f3f9753b4c534c4 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | f16fb6d23b68699eed97fe1edee0d8eecde14a67 (diff) |
hwmon: (chipcap2) fix return path in cc2_request_alarm_irqs()
The return path can be improved by returning upon first failure. The
current implementation would try to register the second interrupt even
if the first one failed, which is unnecessary.
Moreover, if no irqs are available, the return value should be zero
(the driver supports the use case with no interrupts). Currently the
initial value is unassigned and that may lead to returning an unknown
value if stack variables are not automatically set to zero and no irqs
were provided.
Reported-by: Dan Carpenter <[email protected]>
Closes: https://lore.kernel.org/linux-hwmon/[email protected]/T/#t
Signed-off-by: Javier Carrasco <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions