Commit 7c935ae5 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: Fix device leaks in mirred action

When a mirred action is created it takes two references to the
device (dev_get_by_index + dev_hold), but only drops one when
it gets destroyed. It also leaks a reference when a mirred action
is replaced.
Signed-off-by: default avatarPatrick McHardy <kaber@trash.ne>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57f75af4
......@@ -138,8 +138,9 @@ tcf_mirred_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int
p->eaction = parm->eaction;
if (parm->ifindex) {
p->ifindex = parm->ifindex;
if (ovr)
dev_put(p->dev);
p->dev = dev;
dev_hold(p->dev);
}
spin_unlock(&p->lock);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment