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

hwmon: (w83791d) 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
fe04f24b 970255b7

+3
+3
drivers/hwmon/w83791d.c
··· 1181 1181 if (err) 1182 1182 return err; 1183 1183 1184 + if (val > 255) 1185 + return -EINVAL; 1186 + 1184 1187 data->vrm = val; 1185 1188 return count; 1186 1189 }