mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[INET]: Small possible memory leak in FIB rules
This patch fixes a small memory leak. Default fib rules can be deleted by the user if the rule does not carry FIB_RULE_PERMANENT flag, f.e. by ip rule flush Such a rule will not be freed as the ref-counter has 2 on start and becomes clearly unreachable after removal. Signed-off-by: Denis V. Lunev <[email protected]> Acked-by: Alexey Kuznetsov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
33d36bb83c
commit
2994c63863
5 changed files with 62 additions and 64 deletions
|
|
@ -48,15 +48,6 @@ struct dn_fib_rule
|
|||
u8 flags;
|
||||
};
|
||||
|
||||
static struct dn_fib_rule default_rule = {
|
||||
.common = {
|
||||
.refcnt = ATOMIC_INIT(2),
|
||||
.pref = 0x7fff,
|
||||
.table = RT_TABLE_MAIN,
|
||||
.action = FR_ACT_TO_TBL,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res)
|
||||
{
|
||||
|
|
@ -262,8 +253,8 @@ static struct fib_rules_ops dn_fib_rules_ops = {
|
|||
|
||||
void __init dn_fib_rules_init(void)
|
||||
{
|
||||
list_add_tail(&default_rule.common.list,
|
||||
&dn_fib_rules_ops.rules_list);
|
||||
BUG_ON(fib_default_rule_add(&dn_fib_rules_ops, 0x7fff,
|
||||
RT_TABLE_MAIN, 0));
|
||||
fib_rules_register(&dn_fib_rules_ops);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue