diff options
author | David S. Miller <davem@davemloft.net> | 2011-12-23 17:13:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-23 17:13:56 -0500 |
commit | abb434cb0539fb355c1c921f8fd761efbbac3462 (patch) | |
tree | 24a7d99ec161f8fd4dc9ff03c9c4cc93be883ce6 /net/core | |
parent | 2494654d4890316e7340fb8b3458daad0474a1b9 (diff) | |
parent | 6350323ad8def2ac00d77cdee3b79c9b9fba75c4 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
net/bluetooth/l2cap_core.c
Just two overlapping changes, one added an initialization of
a local variable, and another change added a new local variable.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/flow.c | 12 | ||||
-rw-r--r-- | net/core/net-sysfs.c | 7 | ||||
-rw-r--r-- | net/core/sock.c | 6 |
3 files changed, 18 insertions, 7 deletions
diff --git a/net/core/flow.c b/net/core/flow.c index 8ae42de9c79e..e318c7e98042 100644 --- a/net/core/flow.c +++ b/net/core/flow.c | |||
@@ -358,6 +358,18 @@ void flow_cache_flush(void) | |||
358 | put_online_cpus(); | 358 | put_online_cpus(); |
359 | } | 359 | } |
360 | 360 | ||
361 | static void flow_cache_flush_task(struct work_struct *work) | ||
362 | { | ||
363 | flow_cache_flush(); | ||
364 | } | ||
365 | |||
366 | static DECLARE_WORK(flow_cache_flush_work, flow_cache_flush_task); | ||
367 | |||
368 | void flow_cache_flush_deferred(void) | ||
369 | { | ||
370 | schedule_work(&flow_cache_flush_work); | ||
371 | } | ||
372 | |||
361 | static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu) | 373 | static int __cpuinit flow_cache_cpu_prepare(struct flow_cache *fc, int cpu) |
362 | { | 374 | { |
363 | struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu); | 375 | struct flow_cache_percpu *fcp = per_cpu_ptr(fc->percpu, cpu); |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 9d134636f87c..4b4d0b0a3543 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -669,11 +669,14 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, | |||
669 | if (count) { | 669 | if (count) { |
670 | int i; | 670 | int i; |
671 | 671 | ||
672 | if (count > 1<<30) { | 672 | if (count > INT_MAX) |
673 | return -EINVAL; | ||
674 | count = roundup_pow_of_two(count); | ||
675 | if (count > (ULONG_MAX - sizeof(struct rps_dev_flow_table)) | ||
676 | / sizeof(struct rps_dev_flow)) { | ||
673 | /* Enforce a limit to prevent overflow */ | 677 | /* Enforce a limit to prevent overflow */ |
674 | return -EINVAL; | 678 | return -EINVAL; |
675 | } | 679 | } |
676 | count = roundup_pow_of_two(count); | ||
677 | table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count)); | 680 | table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count)); |
678 | if (!table) | 681 | if (!table) |
679 | return -ENOMEM; | 682 | return -ENOMEM; |
diff --git a/net/core/sock.c b/net/core/sock.c index 0c67facf42f3..002939cfc069 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -339,11 +339,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
339 | unsigned long flags; | 339 | unsigned long flags; |
340 | struct sk_buff_head *list = &sk->sk_receive_queue; | 340 | struct sk_buff_head *list = &sk->sk_receive_queue; |
341 | 341 | ||
342 | /* Cast sk->rcvbuf to unsigned... It's pointless, but reduces | 342 | if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) { |
343 | number of warnings when compiling with -W --ANK | ||
344 | */ | ||
345 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
346 | (unsigned)sk->sk_rcvbuf) { | ||
347 | atomic_inc(&sk->sk_drops); | 343 | atomic_inc(&sk->sk_drops); |
348 | trace_sock_rcvqueue_full(sk, skb); | 344 | trace_sock_rcvqueue_full(sk, skb); |
349 | return -ENOMEM; | 345 | return -ENOMEM; |