mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 09:31:26 +00:00
1038bfb236
Coverity reported the following:
*** CID 1530573: (UNINIT)
drivers/net/phy/phy-c45.c:1036 in genphy_c45_plca_set_cfg()
1030 return ret;
1031
1032 val = ret;
1033 }
1034
1035 if (plca_cfg->node_cnt >= 0)
vvv CID 1530573: (UNINIT)
vvv Using uninitialized value "val".
1036 val = (val & ~MDIO_OATC14_PLCA_NCNT) |
1037 (plca_cfg->node_cnt << 8);
1038
1039 if (plca_cfg->node_id >= 0)
1040 val = (val & ~MDIO_OATC14_PLCA_ID) |
1041 (plca_cfg->node_id);
drivers/net/phy/phy-c45.c:1076 in genphy_c45_plca_set_cfg()
1070 return ret;
1071
1072 val = ret;
1073 }
1074
1075 if (plca_cfg->burst_cnt >= 0)
vvv CID 1530573: (UNINIT)
vvv Using uninitialized value "val".
1076 val = (val & ~MDIO_OATC14_PLCA_MAXBC) |
1077 (plca_cfg->burst_cnt << 8);
1078
1079 if (plca_cfg->burst_tmr >= 0)
1080 val = (val & ~MDIO_OATC14_PLCA_BTMR) |
1081 (plca_cfg->burst_tmr);
This is not actually creating a real problem because the path leading to
'val' being used uninitialized will eventually override the full content
of that variable before actually using it for writing the register.
However, the fix is simple and comes at basically no cost.
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Fixes:
|
||
---|---|---|
.. | ||
mscc | ||
adin1100.c | ||
adin.c | ||
amd.c | ||
aquantia_hwmon.c | ||
aquantia_main.c | ||
aquantia.h | ||
at803x.c | ||
ax88796b.c | ||
bcm7xxx.c | ||
bcm63xx.c | ||
bcm87xx.c | ||
bcm54140.c | ||
bcm84881.c | ||
bcm-cygnus.c | ||
bcm-phy-lib.c | ||
bcm-phy-lib.h | ||
bcm-phy-ptp.c | ||
broadcom.c | ||
cicada.c | ||
cortina.c | ||
davicom.c | ||
dp83tc811.c | ||
dp83td510.c | ||
dp83640_reg.h | ||
dp83640.c | ||
dp83822.c | ||
dp83848.c | ||
dp83867.c | ||
dp83869.c | ||
et1011c.c | ||
fixed_phy.c | ||
icplus.c | ||
intel-xway.c | ||
Kconfig | ||
linkmode.c | ||
lxt.c | ||
Makefile | ||
marvell10g.c | ||
marvell-88x2222.c | ||
marvell.c | ||
mdio_bus.c | ||
mdio_device.c | ||
mdio_devres.c | ||
mdio-boardinfo.c | ||
mdio-boardinfo.h | ||
mdio-open-alliance.h | ||
mediatek-ge.c | ||
meson-gxl.c | ||
micrel.c | ||
microchip_t1.c | ||
microchip.c | ||
mii_timestamper.c | ||
motorcomm.c | ||
mxl-gpy.c | ||
national.c | ||
ncn26000.c | ||
nxp-c45-tja11xx.c | ||
nxp-tja11xx.c | ||
phy_device.c | ||
phy_led_triggers.c | ||
phy-c45.c | ||
phy-core.c | ||
phy.c | ||
phylink.c | ||
qsemi.c | ||
realtek.c | ||
rockchip.c | ||
sfp-bus.c | ||
sfp.c | ||
sfp.h | ||
smsc.c | ||
spi_ks8995.c | ||
ste10Xp.c | ||
swphy.c | ||
swphy.h | ||
teranetics.c | ||
uPD60620.c | ||
vitesse.c | ||
xilinx_gmii2rgmii.c |