Skip to content

Commit

Permalink
irqchip/ompic: fix return value check in ompic_of_init()
Browse files Browse the repository at this point in the history
In case of error, the function ioremap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 9b54470 ("irqchip: add initial support for ompic")
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
  • Loading branch information
Wei Yongjun authored and Marc Zyngier committed Jan 4, 2018
1 parent b12f5d0 commit 404e6be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-ompic.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ static int __init ompic_of_init(struct device_node *node,

/* Setup the device */
ompic_base = ioremap(res.start, resource_size(&res));
if (IS_ERR(ompic_base)) {
if (!ompic_base) {
pr_err("ompic: unable to map registers");
return PTR_ERR(ompic_base);
return -ENOMEM;
}

irq = irq_of_parse_and_map(node, 0);
Expand Down

0 comments on commit 404e6be

Please sign in to comment.