* Re: Don't leak 'listeners' in netlink_kernel_create()
[not found] <200710142337.01059.jesper.juhl@gmail.com>
@ 2007-10-14 22:30 ` Eric W. Biederman
2007-10-15 8:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric W. Biederman @ 2007-10-14 22:30 UTC (permalink / raw)
To: Jesper Juhl
Cc: netdev, Linux Kernel Mailing List, Alan Cox, Alexey Kuznetsov,
David Miller
Jesper Juhl <jesper.juhl@gmail.com> writes:
> From: Jesper Juhl <jesper.juhl@gmail.com>
> 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 <jesper.juhl@gmail.com>
This patch appears trivially correct to me.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
>
> af_netlink.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- linux-2.6/net/netlink/af_netlink.c~ 2007-10-14 23:29:50.000000000 +0200
> +++ linux-2.6/net/netlink/af_netlink.c 2007-10-14 23:29:50.000000000 +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();
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Don't leak 'listeners' in netlink_kernel_create()
2007-10-14 22:30 ` Don't leak 'listeners' in netlink_kernel_create() Eric W. Biederman
@ 2007-10-15 8:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-10-15 8:39 UTC (permalink / raw)
To: ebiederm; +Cc: jesper.juhl, netdev, linux-kernel, alan, kuznet
From: ebiederm@xmission.com (Eric W. Biederman)
Date: Sun, 14 Oct 2007 16:30:06 -0600
> Jesper Juhl <jesper.juhl@gmail.com> writes:
>
> > From: Jesper Juhl <jesper.juhl@gmail.com>
> > 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 <jesper.juhl@gmail.com>
>
> This patch appears trivially correct to me.
> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-15 8:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200710142337.01059.jesper.juhl@gmail.com>
2007-10-14 22:30 ` Don't leak 'listeners' in netlink_kernel_create() Eric W. Biederman
2007-10-15 8:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®