Commit 712528cf authored by Patrick McHardy's avatar Patrick McHardy

[NET_SCHED]: Fix module leak in tc_ctl_tfilter error path

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 8d4198e6
...@@ -231,8 +231,12 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) ...@@ -231,8 +231,12 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
tp->classify = tp_ops->classify; tp->classify = tp_ops->classify;
tp->classid = parent; tp->classid = parent;
err = -EBUSY; err = -EBUSY;
if (!try_module_get(tp_ops->owner) || if (!try_module_get(tp_ops->owner)) {
(err = tp_ops->init(tp)) != 0) { kfree(tp);
goto errout;
}
if ((err = tp_ops->init(tp)) != 0) {
module_put(tp_ops->owner);
kfree(tp); kfree(tp);
goto errout; goto errout;
} }
......
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