mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[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: Jesper Juhl <[email protected]> Acked-by: "Eric W. Biederman" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
1dff92e09e
commit
f937f1f46b
1 changed files with 2 additions and 0 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue