aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/amba/ssh:/git@git.zx2c4.com
diff options
context:
space:
mode:
authorKean Ren <rh_king@163.com>2026-05-21 11:52:28 +0800
committerGuenter Roeck <linux@roeck-us.net>2026-05-21 06:48:19 -0700
commite6056b1f5a38bbe57ccbbba2609efecbd87ae08c (patch)
tree73b6e19432b8a38c805ef1d295949ee39607f0b0 /include/linux/amba/ssh:/git@git.zx2c4.com
parenthwmon: (lenovo-ec-sensors): Convert to devm_request_region() (diff)
hwmon: (lenovo-ec-sensors): Fix EC "MCHP" signature validation logic
The EC signature check uses && instead of || between the four byte comparisons. With &&, the condition is true only when ALL four bytes fail to match simultaneously, meaning the driver accepts a device as a valid Microchip EC if ANY single byte of the 4-byte "MCHP" signature happens to match. Due to short-circuit evaluation, if the first byte reads back as 'M' (0x4D, a very common register value), the remaining three comparisons are skipped entirely and the device is accepted. Change && to || so the check rejects devices that do not fully match the expected EC signature, as originally intended. Fixes: 70118f85e6538 ("hwmon: Add EC Chip driver for Lenovo ThinkStation motherboards") Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca> Signed-off-by: Kean Ren <rh_king@163.com> Link: https://lore.kernel.org/r/20260521035228.533317-3-rh_king@163.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/amba/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions