Skip to contentSkip to conversation

net: ethernet: mtk_eth_soc: fix return value check in mtk_wed_add_hw()

PATCH Applied Yang Yingliang 2 participants 2 messages Apr 8, 2022 – Apr 11, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ethernet: mtk_eth_soc: fix return value check in mtk_wed_add_hw()

If syscon_regmap_lookup_by_phandle() fails, it never return NULL pointer, change the check to IS_ERR().

Fixes 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
---
 drivers/net/ethernet/mediatek/mtk_wed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mediatek/mtk_wed.c +1 -1
index f0eacf819cd9..5d510ac24f2a 100644
@@ -813,7 +813,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
 		return;
 
 	regs = syscon_regmap_lookup_by_phandle(np, NULL);
-	if (!regs)
+	if (IS_ERR(regs))
 		return;
 
 	rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops);
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 8 lines · On Fri, 8 Apr 2022 11:22:46 +0800 you wrote:

If syscon_regmap_lookup_by_phandle() fails, it never return NULL pointer, change the check to IS_ERR().

Fixes 804775dfc288 ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")

[...]

Here is the summary with links:
- [-next] net: ethernet: mtk_eth_soc: fix return value check in mtk_wed_add_hw()

    https://git.kernel.org/netdev/net-next/c/b559edfaf3f3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html