net/sched: add missing tracker information in qdisc_create()
authorEric Dumazet <edumazet@google.com>
Tue, 4 Jan 2022 17:04:39 +0000 (09:04 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 5 Jan 2022 17:47:37 +0000 (09:47 -0800)
qdisc_create() error path needs to use dev_put_track()
because qdisc_alloc() allocated the tracker.

Fixes: 606509f27f67 ("net/sched: add net device refcount tracker to struct Qdisc")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220104170439.3790052-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_api.c

index efcd0b5..c9c6f49 100644 (file)
@@ -1292,7 +1292,7 @@ err_out5:
        if (ops->destroy)
                ops->destroy(sch);
 err_out3:
-       dev_put(dev);
+       dev_put_track(dev, &sch->dev_tracker);
        qdisc_free(sch);
 err_out2:
        module_put(ops->owner);