mirror of https://gitee.com/openkylin/linux.git
ethtool: remove unnecessary check in ethtool_get_regs()
We recently changed this function in commit f9fc54d313
("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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fa6821cbf1
commit
ef76c77a05
|
@ -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;
|
||||
}
|
||||
|
||||
ops->get_regs(dev, ®s, regbuf);
|
||||
|
||||
|
|
Loading…
Reference in New Issue