OSDN Git Service

[PATCH] e100: incorrect use of "&&" instead of "&"
authorWilly Tarreau <w@1wt.eu>
Sat, 25 Nov 2006 21:11:36 +0000 (22:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Nov 2006 22:02:20 +0000 (23:02 +0100)
In e100_do_ethtool_ioctl(), bdp->flags is a bitfield and is
checked for some bits but the AND operation is performed with
&& instead of &. Obvious fix is to use "&" as in all other
places. 2.6 does not seem affected.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Acked-by: David Miller <davem@davemloft.net>
drivers/net/e100/e100_main.c

index c9d801a..d67a145 100644 (file)
@@ -3292,11 +3292,11 @@ e100_do_ethtool_ioctl(struct net_device *dev, struct ifreq *ifr)
                if ((bdp->flags & IS_BACHELOR)
                    && (bdp->params.b_params & PRM_FC)) {
                        epause.autoneg = 1;
-                       if (bdp->flags && DF_LINK_FC_CAP) {
+                       if (bdp->flags & DF_LINK_FC_CAP) {
                                epause.rx_pause = 1;
                                epause.tx_pause = 1;
                        }
-                       if (bdp->flags && DF_LINK_FC_TX_ONLY)
+                       if (bdp->flags & DF_LINK_FC_TX_ONLY)
                                epause.tx_pause = 1;
                }
                rc = copy_to_user(ifr->ifr_data, &epause, sizeof(epause))