The read functions might fail and thus "val" might be uninitialized.
The debug function will output the undefined state. Set the value
to zero to be consistent.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23204
Signed-off-by: Robert Marko <robimarko@gmail.com>
static int rtmdio_read_c45(struct mii_bus *bus, int phy, int devnum, int regnum)
{
struct rtmdio_ctrl *ctrl = rtmdio_ctrl_from_bus(bus);
- int ret, val, pn;
+ int ret, pn, val = 0;
pn = rtmdio_phy_to_port(bus, phy);
if (pn < 0)
static int rtmdio_read_c22(struct mii_bus *bus, int phy, int regnum)
{
struct rtmdio_ctrl *ctrl = rtmdio_ctrl_from_bus(bus);
- int ret, val, pn;
+ int ret, pn, val = 0;
pn = rtmdio_phy_to_port(bus, phy);
if (pn < 0)