Commit a77f5db3 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller
Browse files

ethtool: Allocate register dump buffer with vmalloc()



Some NICs have huge register files which exceed the maximum heap
allocation size.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6099e3de
...@@ -815,7 +815,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) ...@@ -815,7 +815,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
if (regs.len > reglen) if (regs.len > reglen)
regs.len = reglen; regs.len = reglen;
regbuf = kmalloc(reglen, GFP_USER); regbuf = vmalloc(reglen);
if (!regbuf) if (!regbuf)
return -ENOMEM; return -ENOMEM;
...@@ -830,7 +830,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr) ...@@ -830,7 +830,7 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
ret = 0; ret = 0;
out: out:
kfree(regbuf); vfree(regbuf);
return ret; return ret;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment