summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/apm
diff options
context:
space:
mode:
authorQuan Nguyen <qnguyen@apm.com>2017-03-15 23:27:17 +0300
committerDavid S. Miller <davem@davemloft.net>2017-03-16 07:52:52 +0300
commit11623fce0f9afef30c45e3f2120b063de3809a8f (patch)
tree298412b85755c030ec6f1b00e96652636c4d3cf2 /drivers/net/ethernet/apm
parente026e700d940a1ea3d3bc84d92ac668b1f015462 (diff)
downloadlinux-11623fce0f9afef30c45e3f2120b063de3809a8f.tar.xz
drivers: net: xgene: Fix wrong logical operation
This patch fixes the wrong logical OR operation by changing it to bit-wise OR operation. Fixes: 3bb502f83080 ("drivers: net: xgene: fix statistics counters race condition") Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Signed-off-by: Quan Nguyen <qnguyen@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/apm')
-rw-r--r--drivers/net/ethernet/apm/xgene/xgene_enet_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index b3568c453b14..ec43278d4b93 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -677,9 +677,9 @@ static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring,
buf_pool->rx_skb[skb_index] = NULL;
/* checking for error */
- status = (GET_VAL(ELERR, le64_to_cpu(raw_desc->m0)) << LERR_LEN) ||
+ status = (GET_VAL(ELERR, le64_to_cpu(raw_desc->m0)) << LERR_LEN) |
GET_VAL(LERR, le64_to_cpu(raw_desc->m0));
- if (unlikely(status > 2)) {
+ if (unlikely(status)) {
dev_kfree_skb_any(skb);
xgene_enet_free_pagepool(page_pool, raw_desc, exp_desc);
xgene_enet_parse_error(rx_ring, netdev_priv(rx_ring->ndev),