summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-09-20 08:42:17 +0000
committerDavid S. Miller <davem@davemloft.net>2010-09-21 14:57:59 -0700
commita77f5db361ed9953b5b749353ea2c7fed2bf8d93 (patch)
tree31f9106359dd0585dc66af0f01d185d758a0dd56
parent6099e3dea9aaa6127cea0610533221c9e956f009 (diff)
downloadblackbird-op-linux-a77f5db361ed9953b5b749353ea2c7fed2bf8d93.tar.gz
blackbird-op-linux-a77f5db361ed9953b5b749353ea2c7fed2bf8d93.zip
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 <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/ethtool.c4
1 files changed, 2 insertions, 2 deletions
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;
}
OpenPOWER on IntegriCloud