lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 5 Jan 2015 15:20:54 +0100 From: Bartosz Golaszewski <bgolaszewski@...libre.com> To: Guenter Roeck <linux@...ck-us.net> Cc: LKML <linux-kernel@...r.kernel.org>, Benoit Cousson <bcousson@...libre.com>, Patrick Titiano <ptitiano@...libre.com>, LM Sensors <lm-sensors@...sensors.org>, Bartosz Golaszewski <bgolaszewski@...libre.com> Subject: [PATCH v8 3/5] hwmon: ina2xx: don't accept shunt values greater than the calibration factor Shunt resistance values greater than the chip's calibration factor make no sense since the actual value written to the register equals: <calibration factor> / <shunt> Bail-out from ina2xx_probe() if the configured value is greater than the calibration factor. Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com> --- drivers/hwmon/ina2xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index 39e017b..3234e57 100644 --- a/drivers/hwmon/ina2xx.c +++ b/drivers/hwmon/ina2xx.c @@ -313,7 +313,8 @@ static int ina2xx_probe(struct i2c_client *client, data->config = &ina2xx_config[data->kind]; data->client = client; - if (data->rshunt <= 0) + if (data->rshunt <= 0 || + data->rshunt > data->config->calibration_factor) return -ENODEV; ret = ina2xx_init(data); -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists