Bug 229721 - src/sys/arm64/rockchip/rk_pinctrl.c:354: poor error checking ?
Summary: src/sys/arm64/rockchip/rk_pinctrl.c:354: poor error checking ?
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-12 10:56 UTC by David Binderman
Modified: 2024-03-01 21:51 UTC (History)
4 users (show)

See Also:


Attachments
Make bias variable signed (726 bytes, patch)
2024-03-01 21:51 UTC, John F. Carr
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2018-07-12 10:56:56 UTC
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.
Comment 1 John F. Carr 2024-03-01 21:51:24 UTC
Created attachment 248859 [details]
Make bias variable signed