Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f937f1f4 authored by Jesper Juhl's avatar Jesper Juhl Committed by David S. Miller
Browse files

[NETLINK]: 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: default avatarJesper Juhl <jesper.juhl@gmail.com>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1dff92e0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1378,6 +1378,8 @@ netlink_kernel_create(struct net *net, int unit, unsigned int groups,
		nl_table[unit].cb_mutex = cb_mutex;
		nl_table[unit].module = module;
		nl_table[unit].registered = 1;
	} else {
		kfree(listeners);
	}
	netlink_table_ungrab();