Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: mediatek: init val in .phy_led_polarity_set for AN7581

Fix smatch warning for uninitialised val in .phy_led_polarity_set for
AN7581 driver.

Correctly init to 0 to set polarity high by default.

Reported-by: Simon Horman <horms@kernel.org>
Fixes: 6a325aed130b ("net: phy: mediatek: add Airoha PHY ID to SoC driver")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20250415105313.3409-1-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Christian Marangi and committed by
Jakub Kicinski
00868d03 4cc8b577

+1 -2
+1 -2
drivers/net/phy/mediatek/mtk-ge-soc.c
··· 1432 1432 static int an7581_phy_led_polarity_set(struct phy_device *phydev, int index, 1433 1433 unsigned long modes) 1434 1434 { 1435 + u16 val = 0; 1435 1436 u32 mode; 1436 - u16 val; 1437 1437 1438 1438 if (index >= MTK_PHY_MAX_LEDS) 1439 1439 return -EINVAL; ··· 1444 1444 val = MTK_PHY_LED_ON_POLARITY; 1445 1445 break; 1446 1446 case PHY_LED_ACTIVE_HIGH: 1447 - val = 0; 1448 1447 break; 1449 1448 default: 1450 1449 return -EINVAL;