diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-01-08 12:31:24 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-01-08 12:31:24 +0100 |
commit | 636f0c70f2557e0819b50c74e31b4a027327015e (patch) | |
tree | 3a259ef26659dac92782651440091b9f5ab1a7f7 /net/core/net-sysfs.c | |
parent | 675eef66e3edcab8065533edfefbcbbacb9a30d3 (diff) | |
parent | 2e885057b7f75035f0b85e02f737891482815a81 (diff) | |
download | op-kernel-dev-636f0c70f2557e0819b50c74e31b4a027327015e.zip op-kernel-dev-636f0c70f2557e0819b50c74e31b4a027327015e.tar.gz |
Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
Diffstat (limited to 'net/core/net-sysfs.c')
-rw-r--r-- | net/core/net-sysfs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index c71c434..385aefe 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -665,11 +665,14 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, if (count) { int i; - if (count > 1<<30) { + if (count > INT_MAX) + return -EINVAL; + count = roundup_pow_of_two(count); + if (count > (ULONG_MAX - sizeof(struct rps_dev_flow_table)) + / sizeof(struct rps_dev_flow)) { /* Enforce a limit to prevent overflow */ return -EINVAL; } - count = roundup_pow_of_two(count); table = vmalloc(RPS_DEV_FLOW_TABLE_SIZE(count)); if (!table) return -ENOMEM; |