Skip to content

hwmon: chipcap2: fix uninitialized symbols

Javier Carrasco linux-hwmon lkml 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected] change-id 20240207-chipcap2_init_vars-b39f8ca470be

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2hwmon: chipcap2: fix uninitialized variable in cc2_get_reg_val()drivers/hwmon/chipcap2.c+3 -11 reply
2/2hwmon: chipcap2: fix return path in cc2_request_alarm_irqs()drivers/hwmon/chipcap2.c+9 -51 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] hwmon: chipcap2: fix uninitialized symbols

Two static checker warnings have been found with Smatch[1] when checking the chipcap2 driver. Two variables might be used uninitialized under certain circumstances (explained in the commit messages).

This series fixes the two warnings and optimizes the error paths involved.

The fixes have been tested with Smatch (including cross function database), and the bugs could not be reproduced anymore.

[1] https://lore.kernel.org/linux-hwmon/[email protected]/T/#t

---
Javier Carrasco (2):
hwmon: chipcap2: fix uninitialized variable in cc2_get_reg_val()
hwmon: chipcap2: fix return path in cc2_request_alarm_irqs()

 drivers/hwmon/chipcap2.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

---
base-commit: 65f976a4299c5de2d2c9162c0337f95b7447243d
change-id: 20240207-chipcap2_init_vars-b39f8ca470be

Best regards,

Signature · 1 line
Javier Carrasco <[email protected]>