Commit edf12b91 authored by Yang Yingliang's avatar Yang Yingliang Committed by Shawn Guo

soc: fsl: guts: fix return value check in fsl_guts_init()

In case of error, of_iomap() returns NULL pointer not ERR_PTR().
The IS_ERR() test in the return value check should be replaced
with NULL test and return -ENOMEM as error value.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarMichael Walle <michael@walle.cc>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 1ec32a4f
......@@ -195,9 +195,9 @@ static int __init fsl_guts_init(void)
soc_data = match->data;
regs = of_iomap(np, 0);
if (IS_ERR(regs)) {
if (!regs) {
of_node_put(np);
return PTR_ERR(regs);
return -ENOMEM;
}
little_endian = of_property_read_bool(np, "little-endian");
......
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