diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index a76a7dab8be7..626652aa9364 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -2509,6 +2509,9 @@ 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) + return -EINVAL; + fecparam.active_fec = 0; fecparam.reserved = 0;