Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH 0/2] hwmon: chipcap2: fix uninitialized symbols
@ 2024-02-07 21:17 Javier Carrasco
  2024-02-07 21:17 ` [PATCH 1/2] hwmon: chipcap2: fix uninitialized variable in cc2_get_reg_val() Javier Carrasco
  2024-02-07 21:17 ` [PATCH 2/2] hwmon: chipcap2: fix return path in cc2_request_alarm_irqs() Javier Carrasco
  0 siblings, 2 replies; 5+ messages in thread
From: Javier Carrasco @ 2024-02-07 21:17 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Dan Carpenter
  Cc: linux-hwmon, linux-kernel, Javier Carrasco

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/294e4634-89d4-415e-a723-b208d8770d7c@gmail.com/T/#t

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
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,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-07 21:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 21:17 [PATCH 0/2] hwmon: chipcap2: fix uninitialized symbols Javier Carrasco
2024-02-07 21:17 ` [PATCH 1/2] hwmon: chipcap2: fix uninitialized variable in cc2_get_reg_val() Javier Carrasco
2024-02-07 21:31   ` Guenter Roeck
2024-02-07 21:17 ` [PATCH 2/2] hwmon: chipcap2: fix return path in cc2_request_alarm_irqs() Javier Carrasco
2024-02-07 21:32   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox