projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c904cda
)
irqchip/mips-gic: Check the return value of ioremap() in gic_of_init()
author
William Dean
<williamsukatube@163.com>
Sat, 23 Jul 2022 10:01:28 +0000
(18:01 +0800)
committer
Marc Zyngier
<maz@kernel.org>
Sun, 24 Jul 2022 09:54:44 +0000
(10:54 +0100)
The function ioremap() in gic_of_init() can fail, so
its return value should be checked.
Reported-by: Hacash Robot <hacashRobot@santino.com>
Signed-off-by: William Dean <williamsukatube@163.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link:
https://lore.kernel.org/r/20220723100128.2964304-1-williamsukatube@163.com
drivers/irqchip/irq-mips-gic.c
patch
|
blob
|
history
diff --git
a/drivers/irqchip/irq-mips-gic.c
b/drivers/irqchip/irq-mips-gic.c
index ff89b36267dd4955e2a1a25184edb0daaf944e73..a1f6d955794aa095ba1d617bb18deb7fb1c26f34 100644
(file)
--- a/
drivers/irqchip/irq-mips-gic.c
+++ b/
drivers/irqchip/irq-mips-gic.c
@@
-734,6
+734,10
@@
static int __init gic_of_init(struct device_node *node,
}
mips_gic_base = ioremap(gic_base, gic_len);
+ if (!mips_gic_base) {
+ pr_err("Failed to ioremap gic_base\n");
+ return -ENOMEM;
+ }
gicconfig = read_gic_config();
gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);