netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, andrew@lunn.ch, mkubecek@suse.cz,
	Jakub Kicinski <kuba@kernel.org>,
	kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: [PATCH net-next 2/3] ethtool: fec: fix FEC_NONE check
Date: Fri, 26 Mar 2021 13:22:22 -0700	[thread overview]
Message-ID: <20210326202223.302085-3-kuba@kernel.org> (raw)
In-Reply-To: <20210326202223.302085-1-kuba@kernel.org>

Dan points out we need to use the mask not the bit (which is 0).

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 42ce127d9864 ("ethtool: fec: sanitize ethtool_fecparam->fec")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 net/ethtool/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.30.2


  parent reply	other threads:[~2021-03-26 20:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 20:22 [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved Jakub Kicinski
2021-03-26 20:22 ` Jakub Kicinski [this message]
2021-03-26 20:22 ` [PATCH net-next 3/3] ethtool: document the enum values not defines Jakub Kicinski
2021-03-26 23:00 ` [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210326202223.302085-3-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=lkp@intel.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).