All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH 01/10] hwmon: (adm1025) Fix vrm write operation
@ 2014-08-06  0:19 Axel Lin
  2014-08-06  2:46 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-08-06  0:19 UTC (permalink / raw)
  To: lm-sensors

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

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/hwmon/adm1025.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hwmon/adm1025.c b/drivers/hwmon/adm1025.c
index d3d0e8c..d6c767a 100644
--- a/drivers/hwmon/adm1025.c
+++ b/drivers/hwmon/adm1025.c
@@ -382,6 +382,9 @@ static ssize_t set_vrm(struct device *dev, struct device_attribute *attr,
 	if (err)
 		return err;
 
+	if (val > 255)
+		return -EINVAL;
+
 	data->vrm = val;
 	return count;
 }
-- 
1.9.1




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] [PATCH 01/10] hwmon: (adm1025) Fix vrm write operation
  2014-08-06  0:19 [lm-sensors] [PATCH 01/10] hwmon: (adm1025) Fix vrm write operation Axel Lin
@ 2014-08-06  2:46 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2014-08-06  2:46 UTC (permalink / raw)
  To: lm-sensors

On 08/05/2014 05:19 PM, Axel Lin wrote:
> vrm is an u8, so the written value needs to be limited to [0, 255].
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---

Series applied, except for the lm85 patch which I had already fixed separately.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-06  2:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-06  0:19 [lm-sensors] [PATCH 01/10] hwmon: (adm1025) Fix vrm write operation Axel Lin
2014-08-06  2:46 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.