Commit ef76c77a authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

ethtool: remove unnecessary check in ethtool_get_regs()

We recently changed this function in commit f9fc54d3 ("ethtool:
check the return value of get_regs_len") such that if "reglen" is zero
we return directly.  That means we can remove this condition as well.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fa6821cb
......@@ -1348,12 +1348,9 @@ static int ethtool_get_regs(struct net_device *dev, char __user *useraddr)
if (regs.len > reglen)
regs.len = reglen;
regbuf = NULL;
if (reglen) {
regbuf = vzalloc(reglen);
if (!regbuf)
return -ENOMEM;
}
regbuf = vzalloc(reglen);
if (!regbuf)
return -ENOMEM;
ops->get_regs(dev, &regs, regbuf);
......
Markdown is supported
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