提交 cf2cc0bf 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

ethtool: fec: fix FEC_NONE check

Dan points out we need to use the mask not the bit (which is 0).
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Fixes: 42ce127d ("ethtool: fec: sanitize ethtool_fecparam->fec")
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ad1cd785
......@@ -2586,7 +2586,7 @@ static int ethtool_set_fecparam(struct net_device *dev, void __user *useraddr)
if (copy_from_user(&fecparam, useraddr, sizeof(fecparam)))
return -EFAULT;
if (!fecparam.fec || fecparam.fec & ETHTOOL_FEC_NONE_BIT)
if (!fecparam.fec || fecparam.fec & ETHTOOL_FEC_NONE)
return -EINVAL;
fecparam.active_fec = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册