From: Ben Hutchings Date: Mon, 20 Sep 2010 08:42:17 +0000 (+0000) Subject: ethtool: Allocate register dump buffer with vmalloc() X-Git-Tag: MMI-PSA29.97-13-9~21994^2~393 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a77f5db361ed9953b5b749353ea2c7fed2bf8d93;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ethtool: Allocate register dump buffer with vmalloc() Some NICs have huge register files which exceed the maximum heap allocation size. Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller --- diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 91ffce20c36b..dae2fd053c2b 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c @@ -815,7 +815,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) if (regs.len > reglen) regs.len = reglen; - regbuf = kmalloc(reglen, GFP_USER); + regbuf = vmalloc(reglen); if (!regbuf) return -ENOMEM; @@ -830,7 +830,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) ret = 0; out: - kfree(regbuf); + vfree(regbuf); return ret; }