diff mbox series

[next] ethtool: fec: Fix bitwise-and with ETHTOOL_FEC_NONE

Message ID 20210326142733.557548-1-colin.king@canonical.com (mailing list archive)
State Accepted
Commit cf2cc0bf4fde7b9db68d605bbe26457aea3685a0
Delegated to: Netdev Maintainers
Headers show
Series [next] ethtool: fec: Fix bitwise-and with ETHTOOL_FEC_NONE | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 7 maintainers not CCed: ecree@solarflare.com andrew@lunn.ch magnus.karlsson@intel.com mkubecek@suse.cz danieller@nvidia.com f.fainelli@gmail.com irusskikh@marvell.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 1 this patch: 1
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
netdev/header_inline success Link

Commit Message

Colin King March 26, 2021, 2:27 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 26, 2021, 11 p.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Fri, 26 Mar 2021 14:27:33 +0000 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [next] ethtool: fec: Fix bitwise-and with ETHTOOL_FEC_NONE
    https://git.kernel.org/netdev/net-next/c/cf2cc0bf4fde

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

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;