Static analysis bug report: atm: idt77252

From: Colin Ian King
Date: Mon Mar 18 2019 - 06:17:55 EST


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:

* 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;

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.