[Bug 229721] src/sys/arm64/rockchip/rk_pinctrl.c:354: poor error checking ?

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jul 12 10:56:58 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229721

            Bug ID: 229721
           Summary: src/sys/arm64/rockchip/rk_pinctrl.c:354: poor error
                    checking ?
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: dcb314 at hotmail.com

src/sys/arm64/rockchip/rk_pinctrl.c:354]: (style) Unsigned variable 'bias'
can't be negative so it is unnecessary to test it.

Source code is

        bias = rk_pinctrl_parse_bias(pin_conf);
        if (bias >= 0) {

but bias is unsigned and the return type of the function is int.

Suggest sanity check return value from function *before* writing
it into an unsigned variable.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list