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: <CAPDyKFpEaG77cq+EgOavaD0zvDmOJVkjJyYq2kP30VtPSikY4g@mail.gmail.com>
Date:   Thu, 14 Sep 2023 16:47:41 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Julia Lawall <Julia.Lawall@...ia.fr>
Cc:     Ludovic Desroches <ludovic.desroches@...rochip.com>,
        kernel-janitors@...r.kernel.org,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Claudiu Beznea <claudiu.beznea@...on.dev>,
        linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 05/11] mmc: atmel-mci: add missing of_node_put

On Thu, 7 Sept 2023 at 11:55, Julia Lawall <Julia.Lawall@...ia.fr> wrote:
>
> for_each_child_of_node performs an of_node_get on each
> iteration, so a break out of the loop requires an
> of_node_put.
>
> This was done using the Coccinelle semantic patch
> iterators/for_each_child.cocci
>
> Signed-off-by: Julia Lawall <Julia.Lawall@...ia.fr>

Applied for next, thanks!

Kind regards
Uffe


>
> ---
>  drivers/mmc/host/atmel-mci.c |    8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff -u -p a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -674,8 +674,10 @@ atmci_of_init(struct platform_device *pd
>                                               "cd", GPIOD_IN, "cd-gpios");
>                 err = PTR_ERR_OR_ZERO(pdata->slot[slot_id].detect_pin);
>                 if (err) {
> -                       if (err != -ENOENT)
> +                       if (err != -ENOENT) {
> +                               of_node_put(cnp);
>                                 return ERR_PTR(err);
> +                       }
>                         pdata->slot[slot_id].detect_pin = NULL;
>                 }
>
> @@ -687,8 +689,10 @@ atmci_of_init(struct platform_device *pd
>                                               "wp", GPIOD_IN, "wp-gpios");
>                 err = PTR_ERR_OR_ZERO(pdata->slot[slot_id].wp_pin);
>                 if (err) {
> -                       if (err != -ENOENT)
> +                       if (err != -ENOENT) {
> +                               of_node_put(cnp);
>                                 return ERR_PTR(err);
> +                       }
>                         pdata->slot[slot_id].wp_pin = NULL;
>                 }
>         }
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ