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] [day] [month] [year] [list]
Message-ID: <CAMuHMdWqMRUf=rZMxTgJx3PQAL6q22wBOi6A_e-o8z+0jyrTgw@mail.gmail.com>
Date:   Tue, 8 Dec 2020 10:13:58 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Krzysztof Kozlowski <krzk@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Lee Jones <lee.jones@...aro.org>,
        Arnd Bergmann <arnd@...db.de>,
        Geert Uytterhoeven <geert+renesas@...der.be>
Subject: Re: [PATCH] soc: fix comment for freeing soc_dev_attr

Hi Krzysztof,

On Mon, Dec 7, 2020 at 8:00 PM Krzysztof Kozlowski <krzk@...nel.org> wrote:
> The soc_dev_attr is stored soc_dev->attr during soc_device_register() so
> it could be used till the cleanup call: soc_device_unregister().
> Therefore this memory should not be freed prior, but after unregistering
> soc device.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>

Thanks for your patch!

> --- a/drivers/base/soc.c
> +++ b/drivers/base/soc.c
> @@ -168,7 +168,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr
>  }
>  EXPORT_SYMBOL_GPL(soc_device_register);
>
> -/* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */
> +/* Ensure soc_dev->attr is freed after calling soc_device_unregister. */

"Ensure" makes it sound like the freeing is taken care of, which is not,
as it should be handled by the caller.

What about "soc_dev->attr should be freed after calling soc_device_unregister."?

>  void soc_device_unregister(struct soc_device *soc_dev)
>  {
>         device_unregister(&soc_dev->dev);

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ