diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-30 13:04:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-30 13:04:14 -0500 |
commit | 7f8e3234c5f7fbdb06be050c8a1907e9c36d7c61 (patch) | |
tree | d6e9edb2087fa4a97b2cc3d585a0189672a14cf4 /net/sched | |
parent | 8ade06c616b34b4237c0ed77d1ff0ce04ad7d056 (diff) | |
parent | 89307babf966165171547f105e2253dec261cfa5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/sch_netem.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index ffcaa597594..a92c1b3dab8 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -532,7 +532,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) @@ -545,9 +545,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; } |