Commit 455aef82 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: Missing dev_put in error path

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 06f4b0a3
...@@ -441,7 +441,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp) ...@@ -441,7 +441,7 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
handle = qdisc_alloc_handle(dev); handle = qdisc_alloc_handle(dev);
err = -ENOMEM; err = -ENOMEM;
if (handle == 0) if (handle == 0)
goto err_out2; goto err_out3;
} }
if (handle == TC_H_INGRESS) if (handle == TC_H_INGRESS)
...@@ -464,6 +464,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp) ...@@ -464,6 +464,8 @@ qdisc_create(struct net_device *dev, u32 handle, struct rtattr **tca, int *errp)
#endif #endif
return sch; return sch;
} }
err_out3:
dev_put(dev);
err_out2: err_out2:
module_put(ops->owner); module_put(ops->owner);
err_out: err_out:
......
...@@ -415,6 +415,7 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops) ...@@ -415,6 +415,7 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops)
if (!ops->init || ops->init(sch, NULL) == 0) if (!ops->init || ops->init(sch, NULL) == 0)
return sch; return sch;
dev_put(dev);
kfree(p); kfree(p);
return NULL; return NULL;
} }
......
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