]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: bcmgenet: fix mask check in bcmgenet_validate_flow()
authorDenis Efremov <efremov@linux.com>
Wed, 2 Sep 2020 11:18:45 +0000 (14:18 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Sep 2020 19:54:12 +0000 (12:54 -0700)
VALIDATE_MASK(eth_mask->h_source) is checked twice in a row in
bcmgenet_validate_flow(). Add VALIDATE_MASK(eth_mask->h_dest)
instead.

Fixes: 9b408d49445a ("net: bcmgenet: add support for ethtool rxnfc flows")
Signed-off-by: Denis Efremov <efremov@linux.com>
Acked-by: Doug Berger <opendmb@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index 1fecc25767bd01651c5050b37eb433b00247ec9d..d95f46ef804037a2acbff7732e836dcc50a9c037 100644 (file)
@@ -1364,7 +1364,7 @@ static int bcmgenet_validate_flow(struct net_device *dev,
        case ETHER_FLOW:
                eth_mask = &cmd->fs.m_u.ether_spec;
                /* don't allow mask which isn't valid */
-               if (VALIDATE_MASK(eth_mask->h_source) ||
+               if (VALIDATE_MASK(eth_mask->h_dest) ||
                    VALIDATE_MASK(eth_mask->h_source) ||
                    VALIDATE_MASK(eth_mask->h_proto)) {
                        netdev_err(dev, "rxnfc: Unsupported mask\n");