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)") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
750d019d70
commit
b559edfaf3
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user