mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
net: ethernet: mtk_wed: Fix NULL vs IS_ERR() bug in mtk_wed_get_memory_region()
We recently changed this from using devm_ioremap() to using
devm_ioremap_resource() and unfortunately the former returns NULL while
the latter returns error pointers. The check for errors needs to be
updated as well.
Fixes: e27dba1951 ("net: Use of_reserved_mem_region_to_resource{_byname}() for "memory-region"")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/87c10dbd-df86-4971-b4f5-40ba02c076fb@sabinyo.mountain
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
1e5e40f255
commit
c2fe3b2a7c
|
|
@ -247,8 +247,10 @@ mtk_wed_get_memory_region(struct mtk_wed_hw *hw, const char *name,
|
|||
region->phy_addr = res.start;
|
||||
region->size = resource_size(&res);
|
||||
region->addr = devm_ioremap_resource(hw->dev, &res);
|
||||
if (IS_ERR(region->addr))
|
||||
return PTR_ERR(region->addr);
|
||||
|
||||
return !region->addr ? -EINVAL : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user