From: Jakub Kicinski Date: Fri, 26 Mar 2021 20:22:22 +0000 (-0700) Subject: ethtool: fec: fix FEC_NONE check X-Git-Tag: howlett/maple/20220722_2~3257^2~372^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cf2cc0bf4fde7b9db68d605bbe26457aea3685a0;p=users%2Fjedix%2Flinux-maple.git ethtool: fec: fix FEC_NONE check Dan points out we need to use the mask not the bit (which is 0). Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 42ce127d9864 ("ethtool: fec: sanitize ethtool_fecparam->fec") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller --- diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 8797533ddc4b..26b3e7086075 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -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;