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

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
...@@ -813,7 +813,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth, ...@@ -813,7 +813,7 @@ void mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
return; return;
regs = syscon_regmap_lookup_by_phandle(np, NULL); regs = syscon_regmap_lookup_by_phandle(np, NULL);
if (!regs) if (IS_ERR(regs))
return; return;
rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops); rcu_assign_pointer(mtk_soc_wed_ops, &wed_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment