From: John Fastabend <john.fastabend@gmail•com>
To: edumazet@google•com, vtlam@google•com
Cc: netdev@vger•kernel.org
Subject: [net PATCH] net: sched: lock imbalance in hhf qdisc
Date: Thu, 01 May 2014 08:15:44 -0700 [thread overview]
Message-ID: <20140501151542.3649.8824.stgit@nitbit.x32> (raw)
hhf_change() takes the sch_tree_lock and releases it but misses the error
cases. Fix the missed case here.
Signed-off-by: John Fastabend <john.r.fastabend@intel•com>
---
net/sched/sch_hhf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index edee03d..1803f89 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -565,8 +565,10 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt)
new_hhf_non_hh_weight = nla_get_u32(tb[TCA_HHF_NON_HH_WEIGHT]);
non_hh_quantum = (u64)new_quantum * new_hhf_non_hh_weight;
- if (non_hh_quantum > INT_MAX)
+ if (non_hh_quantum > INT_MAX) {
+ sch_tree_unlock(sch);
return -EINVAL;
+ }
q->quantum = new_quantum;
q->hhf_non_hh_weight = new_hhf_non_hh_weight;
next reply other threads:[~2014-05-01 15:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-01 15:15 John Fastabend [this message]
2014-05-01 15:30 ` [net PATCH] net: sched: lock imbalance in hhf qdisc Eric Dumazet
2014-05-01 16:15 ` John Fastabend
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140501151542.3649.8824.stgit@nitbit.x32 \
--to=john.fastabend@gmail$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=vtlam@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox