lkml.org 
[lkml]   [2022]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] irqchip: mips-gic: check the return value of ioremap() in gic_of_init()
On Fri, 22 Jul 2022 10:10:08 +0100,
williamsukatube@163.com wrote:
>
> From: William Dean <williamsukatube@gmail.com>
>
> The function ioremap() in gic_of_init() can fail, so
> its return value should be checked.
>
> Fixes: 4bdc0d676a643 ("remove ioremap_nocache and devm_ioremap_nocache")

Erm... No. The issue was definitely there before (just look at the
patch you quote here).

> Reported-by: Hacash Robot <hacashRobot@santino.com>
> Signed-off-by: William Dean <williamsukatube@gmail.com>

If sending from a different address, please add a SoB that matches the
address you are using.

> ---
> drivers/irqchip/irq-mips-gic.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
> index ff89b36267dd..a1f6d955794a 100644
> --- 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);

Thanks,

M.

--
Without deviation from the norm, progress is not possible.

\
 
 \ /
  Last update: 2022-07-22 11:35    [W:0.594 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site