[PATCH v2 1/2] arch: powerpc/kexec: Add missing of_node-put() in default_machine_kexec_prepare()

Tyrel Datwyler tyreld at linux.vnet.ibm.com
Tue Feb 26 10:20:10 AEDT 2019


On 02/25/2019 01:00 AM, Himadri Pandya wrote:
> Decrement the reference count on device_node "node" while breaking out
> of the loop. Issue identified by Coccinelle.
> 
> Signed-off-by: Himadri Pandya <himadri18.07 at gmail.com>
> ---
> Changes in V2:
> 	- Change subject line
> ---
>  arch/powerpc/kernel/machine_kexec_64.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
> index a0f6f45005bd..46edde582984 100644
> --- a/arch/powerpc/kernel/machine_kexec_64.c
> +++ b/arch/powerpc/kernel/machine_kexec_64.c
> @@ -65,6 +65,7 @@ int default_machine_kexec_prepare(struct kimage *image)
>  			end = begin + image->segment[i].memsz;
> 
>  			if ((begin < high) && (end > low))
> +				of_node_put(node);
>  				return -ETXTBSY;

I think the kbuild robot already caught this, but you need to add { } block
around this if now. Previously it was a one line statement, but adding the
of_node_put() makes it multiple lines that now require { }.

-Tyrel

>  		}
>  	}
> 



More information about the Linuxppc-dev mailing list