Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2018 10:56:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 229721] src/sys/arm64/rockchip/rk_pinctrl.c:354: poor error checking ?
Message-ID:  <bug-229721-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229721

            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@FreeBSD.org
          Reporter: dcb314@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 =3D rk_pinctrl_parse_bias(pin_conf);
        if (bias >=3D 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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229721-227>