Commit b559edfa authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller
Browse files

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: 804775df ("net: ethernet: mtk_eth_soc: add support for Wireless Ethernet Dispatch (WED)")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 750d019d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);