mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] ethtool: fec: Fix bitwise-and with ETHTOOL_FEC_NONE
@ 2021-03-26 14:27 Colin King
  2021-03-26 23:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-03-26 14:27 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, netdev; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently ETHTOOL_FEC_NONE_BIT is being used as a mask, however
this is zero and the mask should be using ETHTOOL_FEC_NONE instead.
Fix this.

Addresses-Coverity: ("Bitwise-and with zero")
Fixes: 42ce127d9864 ("ethtool: fec: sanitize ethtool_fecparam->fec")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-26 23:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 14:27 [PATCH][next] ethtool: fec: Fix bitwise-and with ETHTOOL_FEC_NONE Colin King
2021-03-26 23:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®