NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/50621: sys/dev/i2c/adm1021.c:238: read uninit local data ?



>Number:         50621
>Category:       kern
>Synopsis:       sys/dev/i2c/adm1021.c:238: read uninit local data ?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 04 15:40:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160104
>Organization:
>Environment:
>Description:
[sys/dev/i2c/adm1021.c:238]: (error) Uninitialized variable: data

Source code is

        if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
            &cmd, sizeof cmd, &comp, sizeof comp, 0) == 0 &&
            data != ADMTEMP_LOW_DEFAULT) {

Maybe better code

        if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
            &cmd, sizeof cmd, &comp, sizeof comp, 0) == 0 &&
            comp != ADMTEMP_LOW_DEFAULT) {

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index