Bug 201593 - usr/src/sys/dev/iicbus/max6690.c:372: poor error checking ?
Summary: usr/src/sys/dev/iicbus/max6690.c:372: poor error checking ?
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 10.2-BETA1
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-15 16:26 UTC by David Binderman
Modified: 2019-01-15 23:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2015-07-15 16:26:35 UTC
[usr/src/sys/dev/iicbus/max6690.c:372]: (style) Checking if unsigned variable 'temp' is less than zero.

Source code is

   temp = max6690_sensor_read(sens);
    if (temp < 0)
        return (EIO);

Function max6690_sensor_read has an int return value, which should be sanity
checked >= 0, before writing into unsigned variable temp.
Comment 1 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-15 23:58:45 UTC
Thanks for reporting. The fix was committed as base r259080.

Closing as fixed