Skip to contentSkip to conversation

linux-4.4-rc8/drivers/hwmon/lm93.c:398: possible int/long mixup ?

lm-sensors David Binderman 1 participant 1 message Jan 4, 2016

lore
Share & tools
lore
#0 lore raw

Hello there,

[linux-4.4-rc8/drivers/hwmon/lm93.c:398]: (style) int result is assigned to long variable. If the variable is long to avoid loss of information, then you have loss of information.

Source code is

    const long uv_vid = vid * 1000;

Suggest new code

    const long uv_vid = vid * 1000L;

to make sure that integer overflow will not occur.

Regards

David Binderman

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors