Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (adm1025) Fix vrm write operation

vrm is an u8, so the written value needs to be limited to [0, 255].

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Axel Lin and committed by
Guenter Roeck
9c8ae728 eeeafd38

+3
+3
drivers/hwmon/adm1025.c
··· 382 382 if (err) 383 383 return err; 384 384 385 + if (val > 255) 386 + return -EINVAL; 387 + 385 388 data->vrm = val; 386 389 return count; 387 390 }