Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1435292 > unrolled thread

Re: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling of_parse_phandle

Started byGeert Uytterhoeven <geert@linux-m68k.org>
First post2016-07-01 14:40 +0200
Last post2016-07-04 09:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing  of_node_put after calling of_parse_phandle Geert Uytterhoeven <geert@linux-m68k.org> - 2016-07-01 14:40 +0200
    RE: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing  of_node_put after calling of_parse_phandle Peter Chen <peter.chen@nxp.com> - 2016-07-04 09:50 +0200

#1435292 — Re: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling of_parse_phandle

FromGeert Uytterhoeven <geert@linux-m68k.org>
Date2016-07-01 14:40 +0200
SubjectRe: [PATCH 2/7] arm: mach-shmobile: pm-rmobile: add missing of_node_put after calling of_parse_phandle
Message-ID<rQ5TI-6DF-5@gated-at.bofh.it>
Hi Peter,

On Fri, Jul 1, 2016 at 11:41 AM, Peter Chen <peter.chen@nxp.com> wrote:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Magnus Damm <magnus.damm@gmail.com>
> Signed-off-by: Peter Chen <peter.chen@nxp.com>

NAKed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/arch/arm/mach-shmobile/pm-rmobile.c
> +++ b/arch/arm/mach-shmobile/pm-rmobile.c
> @@ -209,6 +209,7 @@ static void __init add_special_pd(struct device_node *np, enum pd_types type)
>         special_pds[num_special_pds].pd = pd;

The pd pointer is stored in the line above, and released later in
put_special_pds().

>         special_pds[num_special_pds].type = type;
>         num_special_pds++;
> +       of_node_put(pd);

Hence it must not be released here, as that would cause a double release
when put_special_pds() is executed.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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

[toc] | [next] | [standalone]


#1436223

FromPeter Chen <peter.chen@nxp.com>
Date2016-07-04 09:50 +0200
Message-ID<rR6NH-2Pw-7@gated-at.bofh.it>
In reply to#1435292
 
>On Fri, Jul 1, 2016 at 11:41 AM, Peter Chen <peter.chen@nxp.com> wrote:
>> of_node_put needs to be called when the device node which is got from
>> of_parse_phandle has finished using.
>>
>> Cc: Simon Horman <horms@verge.net.au>
>> Cc: Magnus Damm <magnus.damm@gmail.com>
>> Signed-off-by: Peter Chen <peter.chen@nxp.com>
>
>NAKed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
>> --- a/arch/arm/mach-shmobile/pm-rmobile.c
>> +++ b/arch/arm/mach-shmobile/pm-rmobile.c
>> @@ -209,6 +209,7 @@ static void __init add_special_pd(struct device_node *np,
>enum pd_types type)
>>         special_pds[num_special_pds].pd = pd;
>
>The pd pointer is stored in the line above, and released later in put_special_pds().
>
>>         special_pds[num_special_pds].type = type;
>>         num_special_pds++;
>> +       of_node_put(pd);
>
>Hence it must not be released here, as that would cause a double release when
>put_special_pds() is executed.
>

Thanks, Geert, it is my careless.

Please forget this patch.

Peter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web