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

Peter Chen peter.chen at nxp.com
Sun Jul 3 19:10:04 PDT 2016


 
>On Fri, Jul 1, 2016 at 11:41 AM, Peter Chen <peter.chen at 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 at verge.net.au>
>> Cc: Magnus Damm <magnus.damm at gmail.com>
>> Signed-off-by: Peter Chen <peter.chen at nxp.com>
>
>NAKed-by: Geert Uytterhoeven <geert+renesas at 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


More information about the linux-arm-kernel mailing list