[PATCH 1/3] powerpc: numa: Remove double of_node_put in hot_add_node_scn_to_nid

Stephen Rothwell sfr at canb.auug.org.au
Wed Aug 10 18:33:28 EST 2011


Hi Anton,

On Wed, 10 Aug 2011 16:49:34 +1000 Anton Blanchard <anton at samba.org> wrote:
>
> During memory hotplug testing, I got the following warning:
> 
> 
> ERROR: Bad of_node_put() on /memory at 0
> 
> of_find_node_by_type() loop does of_node_put for us so remove the
> duplicate one inside the loop.

But does an of_node_get() on its return value ..

> Signed-off-by: Anton Blanchard <anton at samba.org>
> Cc: stable at kernel.org
> ---
> 
> Index: linux-powerpc/arch/powerpc/mm/numa.c
> ===================================================================
> --- linux-powerpc.orig/arch/powerpc/mm/numa.c	2011-06-06 08:07:35.148708089 +1000
> +++ linux-powerpc/arch/powerpc/mm/numa.c	2011-08-10 11:31:59.723379868 +1000
> @@ -1214,7 +1214,6 @@ int hot_add_node_scn_to_nid(unsigned lon
>  			break;
>  		}
>  
> -		of_node_put(memory);
>  		if (nid >= 0)
>  			break;
>  	}

Won't that need an of_node_put(memory) after the loop if (nid >= 0) ?  In
fact you should be able to just move the of_node_put(memory) to after the
loop since of_node_put(NULL) is fine.

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20110810/4b232b98/attachment.pgp>


More information about the Linuxppc-dev mailing list