Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/aspeed-i2c-ic: Fix return value check in aspeed_i2c_ic_of_init()

In case of error, the function of_iomap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test..

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

authored by

Wei Yongjun and committed by
Marc Zyngier
7bdeb7f5 215f4cc0

+2 -2
+2 -2
drivers/irqchip/irq-aspeed-i2c-ic.c
··· 76 76 return -ENOMEM; 77 77 78 78 i2c_ic->base = of_iomap(node, 0); 79 - if (IS_ERR(i2c_ic->base)) { 80 - ret = PTR_ERR(i2c_ic->base); 79 + if (!i2c_ic->base) { 80 + ret = -ENOMEM; 81 81 goto err_free_ic; 82 82 } 83 83