summaryrefslogtreecommitdiff
path: root/net/sched/sch_netem.c
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2012-01-05 12:51:32 -0600
committerClark Williams <williams@redhat.com>2012-01-05 12:51:32 -0600
commitd76fe430665fac3f44ee88958713ecc524fd778d (patch)
tree00206c8b11eb2084d38eeccfe4b41f5e89fb779c /net/sched/sch_netem.c
parent63076d7f7f7f2650e5d0a4fa5dd2c412a255c237 (diff)
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
Merge commit 'v3.2' into rt-3.2-rt9v3.2-rt9
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r--net/sched/sch_netem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index eb3b9a86c6ed..a4ab207cdc59 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -488,7 +488,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
return -EINVAL;
s = sizeof(struct disttable) + n * sizeof(s16);
- d = kmalloc(s, GFP_KERNEL);
+ d = kmalloc(s, GFP_KERNEL | __GFP_NOWARN);
if (!d)
d = vmalloc(s);
if (!d)
@@ -501,9 +501,10 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
root_lock = qdisc_root_sleeping_lock(sch);
spin_lock_bh(root_lock);
- dist_free(q->delay_dist);
- q->delay_dist = d;
+ swap(q->delay_dist, d);
spin_unlock_bh(root_lock);
+
+ dist_free(d);
return 0;
}