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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFr9PXnDqbgd4AebPQepWe5RF2utPcp2PJGoVhVNwX3ZZzsc-g@mail.gmail.com>
Date:   Fri, 13 May 2022 20:14:32 +0900
From:   Daniel Palmer <daniel@...f.com>
To:     Marc Zyngier <maz@...nel.org>
Cc:     linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-tegra@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        kernel-team@...roid.com, Daniel Palmer <daniel@...ngy.jp>,
        Romain Perier <romain.perier@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Robert Richter <rric@...nel.org>,
        Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Subject: Re: [PATCH] gpio: Remove dynamic allocation from populate_parent_alloc_arg()

Hi March,

On Fri, 13 May 2022 at 01:23, Marc Zyngier <maz@...nel.org> wrote:
> diff --git a/drivers/gpio/gpio-msc313.c b/drivers/gpio/gpio-msc313.c
> index b2c90bdd39d0..52d7b8d99170 100644
> --- a/drivers/gpio/gpio-msc313.c
> +++ b/drivers/gpio/gpio-msc313.c
> @@ -550,15 +550,12 @@ static struct irq_chip msc313_gpio_irqchip = {
>   * so we need to provide the fwspec. Essentially gpiochip_populate_parent_fwspec_twocell
>   * that puts GIC_SPI into the first cell.
>   */
> -static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
> -                                            unsigned int parent_hwirq,
> -                                            unsigned int parent_type)
> +static int msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
> +                                             union gpio_irq_fwspec *gfwspec,
> +                                             unsigned int parent_hwirq,
> +                                             unsigned int parent_type)
>  {
> -       struct irq_fwspec *fwspec;
> -
> -       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
> -       if (!fwspec)
> -               return NULL;
> +       struct irq_fwspec *fwspec = &gfwspec->fwspec;
>
>         fwspec->fwnode = gc->irq.parent_domain->fwnode;
>         fwspec->param_count = 3;
> @@ -566,7 +563,7 @@ static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
>         fwspec->param[1] = parent_hwirq;
>         fwspec->param[2] = parent_type;
>
> -       return fwspec;
> +       return 0;
>  }
>
>  static int msc313e_gpio_child_to_parent_hwirq(struct gpio_chip *chip,

This bit looks fine to me. I will test it over the weekend.

Cheers,

Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ