Message ID | 20210621175449.880248-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0cd58e5c53babb9237b741dbef711f0a9eb6d3fd |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] pkt_sched: sch_qfq: fix qfq_change_class() error path | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | fail | 1 blamed authors not CCed: paolo.valente@unimore.it; 3 maintainers not CCed: paolo.valente@unimore.it jiri@resnulli.us jhs@mojatatu.com |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | WARNING: Possible repeated word: 'Google' |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
Hello: This patch was applied to netdev/net.git (refs/heads/master): On Mon, 21 Jun 2021 10:54:49 -0700 you wrote: > From: Eric Dumazet <edumazet@google.com> > > If qfq_change_class() is unable to allocate memory for qfq_aggregate, > it frees the class that has been inserted in the class hash table, > but does not unhash it. > > Defer the insertion after the problematic allocation. > > [...] Here is the summary with links: - [net] pkt_sched: sch_qfq: fix qfq_change_class() error path https://git.kernel.org/netdev/net/c/0cd58e5c53ba You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c index 1db9d4a2ef5efcd6ace03fc22d4ea1c69a2847be..b692a0de1ad5e5af8c630d7ddf68be4e62645c5b 100644 --- a/net/sched/sch_qfq.c +++ b/net/sched/sch_qfq.c @@ -485,11 +485,6 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, if (cl->qdisc != &noop_qdisc) qdisc_hash_add(cl->qdisc, true); - sch_tree_lock(sch); - qdisc_class_hash_insert(&q->clhash, &cl->common); - sch_tree_unlock(sch); - - qdisc_class_hash_grow(sch, &q->clhash); set_change_agg: sch_tree_lock(sch); @@ -507,8 +502,11 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, } if (existing) qfq_deact_rm_from_agg(q, cl); + else + qdisc_class_hash_insert(&q->clhash, &cl->common); qfq_add_to_agg(q, new_agg, cl); sch_tree_unlock(sch); + qdisc_class_hash_grow(sch, &q->clhash); *arg = (unsigned long)cl; return 0;