From: Yang Yingliang Date: Tue, 28 Jun 2022 14:02:48 +0000 (+0800) Subject: soc: fsl: guts: fix return value check in fsl_guts_init() X-Git-Tag: v6.6.17~6970^2~5^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edf12b913abb69abce4cd6996398a4ce23e5b047;p=platform%2Fkernel%2Flinux-rpi.git 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: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Michael Walle Signed-off-by: Shawn Guo --- diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 27035de062f8..8038c599ad83 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -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");