All of lore.kernel.org
 help / color / mirror / Atom feed
* re: hwmon: add MP2925 and MP2929 driver
@ 2025-09-26 14:17 Colin King (gmail)
  2025-09-26 16:12 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King (gmail) @ 2025-09-26 14:17 UTC (permalink / raw)
  To: Wensheng Wang, Guenter Roeck, Noah Wang, linux-hwmon
  Cc: linux-kernel@vger.kernel.org


[-- Attachment #1.1.1: Type: text/plain, Size: 953 bytes --]

Hi,

Static analysis on linux-next has found an issue in function 
mp2925_write_word_data with the following commit:

commit b3a4efc88601cb5fc97b4ae23c478700a60302da
Author: Wensheng Wang <wenswang@yeah.net>
Date:   Thu Sep 18 16:06:03 2025 +0800

     hwmon: add MP2925 and MP2929 driver


The issue is as follows:

         case PMBUS_VOUT_OV_FAULT_LIMIT:
         case PMBUS_VOUT_UV_FAULT_LIMIT:
                 ret = pmbus_write_word_data(client, page, reg,
                                             (ret & ~GENMASK(11, 0)) |
                                 FIELD_PREP(GENMASK(11, 0),
                                            DIV_ROUND_CLOSEST(word * 
MP2925_VOUT_OVUV_DIV,
  
MP2925_VOUT_OVUV_UINT)));
                 break;

The call to pmbus_write_word_data() is accessing variable ret via the 
mask ~GENMASK(11, 0) however at this point ret has not been initialized 
so it contains a garbage value.

Colin

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 4901 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

end of thread, other threads:[~2025-09-26 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-26 14:17 hwmon: add MP2925 and MP2929 driver Colin King (gmail)
2025-09-26 16:12 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.