From 84a31f8b43f38845e96965b24eaeb76066433ebd Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 28 Jun 2010 08:44:07 +0000 Subject: [PATCH] --- yaml --- r: 200858 b: refs/heads/master c: db048b69037e7fa6a7d9e95a1271a50dc08ae233 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/core/ethtool.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 9aee4358e260..2d512ff523e3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c22d7ac844f1cb9c6a5fd20f89ebadc2feef891b +refs/heads/master: db048b69037e7fa6a7d9e95a1271a50dc08ae233 diff --git a/trunk/net/core/ethtool.c b/trunk/net/core/ethtool.c index a0f4964033d2..a3a7e9a48dff 100644 --- a/trunk/net/core/ethtool.c +++ b/trunk/net/core/ethtool.c @@ -347,8 +347,9 @@ static noinline_for_stack int ethtool_get_rxnfc(struct net_device *dev, if (info.cmd == ETHTOOL_GRXCLSRLALL) { if (info.rule_cnt > 0) { - rule_buf = kmalloc(info.rule_cnt * sizeof(u32), - GFP_USER); + if (info.rule_cnt <= KMALLOC_MAX_SIZE / sizeof(u32)) + rule_buf = kmalloc(info.rule_cnt * sizeof(u32), + GFP_USER); if (!rule_buf) return -ENOMEM; }