lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhSdy2OXsFx973MnE0LBEzKK0r4OWYWXbKrNnuW6Gbanfo-bQ@mail.gmail.com>
Date: Tue, 1 Oct 2024 17:24:29 +0530
From: Anup Patel <anup@...infault.org>
To: Charlie Jenkins <charlie@...osinc.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Paul Walmsley <paul.walmsley@...ive.com>, 
	Samuel Holland <samuel.holland@...ive.com>, Dan Carpenter <dan.carpenter@...aro.org>, 
	Anup Patel <apatel@...tanamicro.com>, linux-kernel@...r.kernel.org, 
	linux-riscv@...ts.infradead.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] irqchip/sifive-plic: Fix error codes

On Wed, Sep 4, 2024 at 5:11 AM Charlie Jenkins <charlie@...osinc.com> wrote:
>
> Set error to -ENOMEM if kcalloc() fails or if irq_domain_add_linear()
> fails inside of plic_probe().
>

Like Alex mentioned, please include a Fixes tag.

> Signed-off-by: Charlie Jenkins <charlie@...osinc.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/r/202409031122.yBh8HrxA-lkp@intel.com/

LGTM.

Reviewed-by: Anup Patel <anup@...infault.org>

Regards,
Anup

> ---
>  drivers/irqchip/irq-sifive-plic.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
> index 2f6ef5c495bd..0b730e305748 100644
> --- a/drivers/irqchip/irq-sifive-plic.c
> +++ b/drivers/irqchip/irq-sifive-plic.c
> @@ -626,8 +626,10 @@ static int plic_probe(struct fwnode_handle *fwnode)
>
>                 handler->enable_save = kcalloc(DIV_ROUND_UP(nr_irqs, 32),
>                                                sizeof(*handler->enable_save), GFP_KERNEL);
> -               if (!handler->enable_save)
> +               if (!handler->enable_save) {
> +                       error = -ENOMEM;
>                         goto fail_cleanup_contexts;
> +               }
>  done:
>                 for (hwirq = 1; hwirq <= nr_irqs; hwirq++) {
>                         plic_toggle(handler, hwirq, 0);
> @@ -639,8 +641,10 @@ static int plic_probe(struct fwnode_handle *fwnode)
>
>         priv->irqdomain = irq_domain_create_linear(fwnode, nr_irqs + 1,
>                                                    &plic_irqdomain_ops, priv);
> -       if (WARN_ON(!priv->irqdomain))
> +       if (WARN_ON(!priv->irqdomain)) {
> +               error = -ENOMEM;
>                 goto fail_cleanup_contexts;
> +       }
>
>         /*
>          * We can have multiple PLIC instances so setup global state
>
> ---
> base-commit: 6804f0edbe7747774e6ae60f20cec4ee3ad7c187
> change-id: 20240903-correct_error_codes_sifive_plic-4611f59291df
> --
> - Charlie
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ