aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/net-sysfs.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-12-23 17:13:56 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-23 17:13:56 -0500
commitabb434cb0539fb355c1c921f8fd761efbbac3462 (patch)
tree24a7d99ec161f8fd4dc9ff03c9c4cc93be883ce6 /net/core/net-sysfs.c
parent2494654d4890316e7340fb8b3458daad0474a1b9 (diff)
parent6350323ad8def2ac00d77cdee3b79c9b9fba75c4 (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/net-sysfs.c')
-rw-r--r--net/core/net-sysfs.c7
1 files changed, 5 insertions, 2 deletions
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;