summaryrefslogtreecommitdiff
path: root/include/asm-cris/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorSanman Pradhan <psanman@juniper.net>2026-03-29 17:09:40 +0000
committerGuenter Roeck <linux@roeck-us.net>2026-03-29 19:04:16 -0700
commit0e211f6aaa6a00fd0ee0c1eea5498f168c6725e6 (patch)
tree2a699a22b7859cc405d8dbbd1dde27de486a1707 /include/asm-cris/git@git.tavy.me:linux.git
parent7aaa8047eafd0bd628065b15757d9b48c5f9c07d (diff)
hwmon: (tps53679) Fix array access with zero-length block read
i2c_smbus_read_block_data() can return 0, indicating a zero-length read. When this happens, tps53679_identify_chip() accesses buf[ret - 1] which is buf[-1], reading one byte before the buffer on the stack. Fix by changing the check from "ret < 0" to "ret <= 0", treating a zero-length read as an error (-EIO), which prevents the out-of-bounds array access. Also fix a typo in the adjacent comment: "if present" instead of duplicate "if". Fixes: 75ca1e5875fe ("hwmon: (pmbus/tps53679) Add support for TPS53685") Signed-off-by: Sanman Pradhan <psanman@juniper.net> Link: https://lore.kernel.org/r/20260329170925.34581-2-sanman.pradhan@hpe.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/asm-cris/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions