# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/08/22 14:33:26+02:00 kaber@coreworks.de # [PKT_SCHED]: Missing dev_put in error path # # Signed-off-by: Patrick McHardy # # net/sched/sch_generic.c # 2004/08/22 14:33:06+02:00 kaber@coreworks.de +1 -0 # [PKT_SCHED]: Missing dev_put in error path # # net/sched/sch_api.c # 2004/08/22 14:33:06+02:00 kaber@coreworks.de +3 -1 # [PKT_SCHED]: Missing dev_put in error path # diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c 2004-08-22 14:34:34 +02:00 +++ b/net/sched/sch_api.c 2004-08-22 14:34:34 +02:00 @@ -441,7 +441,7 @@ handle = qdisc_alloc_handle(dev); err = -ENOMEM; if (handle == 0) - goto err_out2; + goto err_out3; } if (handle == TC_H_INGRESS) @@ -464,6 +464,8 @@ #endif return sch; } +err_out3: + dev_put(dev); err_out2: module_put(ops->owner); err_out: diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c 2004-08-22 14:34:34 +02:00 +++ b/net/sched/sch_generic.c 2004-08-22 14:34:34 +02:00 @@ -415,6 +415,7 @@ if (!ops->init || ops->init(sch, NULL) == 0) return sch; + dev_put(dev); kfree(p); return NULL; }