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

hwmon: (asb100) 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
db59ac43 a4461647

+4
+4
drivers/hwmon/asb100.c
··· 510 510 err = kstrtoul(buf, 10, &val); 511 511 if (err) 512 512 return err; 513 + 514 + if (val > 255) 515 + return -EINVAL; 516 + 513 517 data->vrm = val; 514 518 return count; 515 519 }