mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
mpls: fix mpls_net_init memory leak
Fix a memory leak in the mpls netns init function in case of failure. If
register_net_sysctl fails then we need to free the ctl_table.
Fixes: 7720c01f3f ("mpls: Add a sysctl to control the size of the mpls label table")
Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
f0fa6e529e
commit
6ea3c9d5b0
1 changed files with 3 additions and 1 deletions
|
|
@ -1177,8 +1177,10 @@ static int mpls_net_init(struct net *net)
|
|||
|
||||
table[0].data = net;
|
||||
net->mpls.ctl = register_net_sysctl(net, "net/mpls", table);
|
||||
if (net->mpls.ctl == NULL)
|
||||
if (net->mpls.ctl == NULL) {
|
||||
kfree(table);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue