Re: Don't leak 'listeners' in netlink_kernel_create()

2007-10-15 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman)
Date: Sun, 14 Oct 2007 16:30:06 -0600

> Jesper Juhl <[EMAIL PROTECTED]> writes:
> 
> > From: Jesper Juhl <[EMAIL PROTECTED]>
> > Subject: Don't leak 'listeners' in netlink_kernel_create()
> >
> > The Coverity checker spotted that we'll leak the storage allocated 
> > to 'listeners' in netlink_kernel_create() when the
> >   if (!nl_table[unit].registered)
> > check is false.
> >
> > This patch avoids the leak.
> >
> >
> > Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>
> 
> This patch appears trivially correct to me.
> Acked-by: "Eric W. Biederman" <[EMAIL PROTECTED]>

Applied, thanks everyone.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Don't leak 'listeners' in netlink_kernel_create()

2007-10-15 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman)
Date: Sun, 14 Oct 2007 16:30:06 -0600

 Jesper Juhl [EMAIL PROTECTED] writes:
 
  From: Jesper Juhl [EMAIL PROTECTED]
  Subject: Don't leak 'listeners' in netlink_kernel_create()
 
  The Coverity checker spotted that we'll leak the storage allocated 
  to 'listeners' in netlink_kernel_create() when the
if (!nl_table[unit].registered)
  check is false.
 
  This patch avoids the leak.
 
 
  Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
 
 This patch appears trivially correct to me.
 Acked-by: Eric W. Biederman [EMAIL PROTECTED]

Applied, thanks everyone.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Don't leak 'listeners' in netlink_kernel_create()

2007-10-14 Thread Eric W. Biederman
Jesper Juhl <[EMAIL PROTECTED]> writes:

> From: Jesper Juhl <[EMAIL PROTECTED]>
> Subject: Don't leak 'listeners' in netlink_kernel_create()
>
> The Coverity checker spotted that we'll leak the storage allocated 
> to 'listeners' in netlink_kernel_create() when the
>   if (!nl_table[unit].registered)
> check is false.
>
> This patch avoids the leak.
>
>
> Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>

This patch appears trivially correct to me.
Acked-by: "Eric W. Biederman" <[EMAIL PROTECTED]>

> ---
>
>  af_netlink.c |2 ++
>  1 file changed, 2 insertions(+)
>
> --- linux-2.6/net/netlink/af_netlink.c~   2007-10-14 23:29:50.0 
> +0200
> +++ linux-2.6/net/netlink/af_netlink.c2007-10-14 23:29:50.0 
> +0200
> @@ -1378,6 +1378,8 @@ netlink_kernel_create(struct net *net, i
>   nl_table[unit].cb_mutex = cb_mutex;
>   nl_table[unit].module = module;
>   nl_table[unit].registered = 1;
> + } else {
> + kfree(listeners);
>   }
>   netlink_table_ungrab();
>  
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Don't leak 'listeners' in netlink_kernel_create()

2007-10-14 Thread Eric W. Biederman
Jesper Juhl [EMAIL PROTECTED] writes:

 From: Jesper Juhl [EMAIL PROTECTED]
 Subject: Don't leak 'listeners' in netlink_kernel_create()

 The Coverity checker spotted that we'll leak the storage allocated 
 to 'listeners' in netlink_kernel_create() when the
   if (!nl_table[unit].registered)
 check is false.

 This patch avoids the leak.


 Signed-off-by: Jesper Juhl [EMAIL PROTECTED]

This patch appears trivially correct to me.
Acked-by: Eric W. Biederman [EMAIL PROTECTED]

 ---

  af_netlink.c |2 ++
  1 file changed, 2 insertions(+)

 --- linux-2.6/net/netlink/af_netlink.c~   2007-10-14 23:29:50.0 
 +0200
 +++ linux-2.6/net/netlink/af_netlink.c2007-10-14 23:29:50.0 
 +0200
 @@ -1378,6 +1378,8 @@ netlink_kernel_create(struct net *net, i
   nl_table[unit].cb_mutex = cb_mutex;
   nl_table[unit].module = module;
   nl_table[unit].registered = 1;
 + } else {
 + kfree(listeners);
   }
   netlink_table_ungrab();
  
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/