Static analysis bug report: atm: idt77252

From: Colin Ian King <hidden>
Date: 2019-03-18 10:17:54
Also in: lkml

Hi,

Static analysis with cppcheck has detected an uninitialized variable in
the idt77252 driver:

The variable linkrate is only initialized when
CONFIG_ATM_IDT77252_USE_SUNI is enabled:

#ifdef  CONFIG_ATM_IDT77252_USE_SUNI
        /*
         * this is a jhs hack to get around special functionality in the
         * phy driver for the atecom hardware; the functionality doesn't
         * exist in the linux atm suni driver
         *
         * it isn't the right way to do things, but as the guy from NIST
         * said, talking about their measurement of the fine structure
         * constant, "it's good enough for government work."
         */
        linkrate = 149760000;
#endif

        card->link_pcr = (linkrate / 8 / 53);

I suspect the driver is being used with CONFIG_ATM_IDT77252_USE_SUNI
enabled, however, this probably needs fixing with the correct value
(whatever that is) when CONFIG_ATM_IDT77252_USE_SUNI is not enabled.

Colin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help