public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: RDMA list <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH] mlx4: properly mask MGM entry members count
Date: Mon, 15 Nov 2010 16:08:29 +0200	[thread overview]
Message-ID: <20101115140829.GA20355@mtldesk30> (raw)

The members_count field size is 24 bits so mask it properly when reading it.

Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/net/mlx4/mcg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index c4f88b7..fff20fc 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -187,7 +187,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
 		memcpy(mgm->gid, gid, 16);
 	}
 
-	members_count = be32_to_cpu(mgm->members_count);
+	members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
 	if (members_count == MLX4_QP_PER_MGM) {
 		mlx4_err(dev, "MGM at index %x is full.\n", index);
 		err = -ENOMEM;
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2010-11-15 14:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-15 14:08 Eli Cohen [this message]
2010-11-16  9:38 ` [PATCH] mlx4: properly mask MGM entry members count Aleksey Senin
     [not found]   ` <AANLkTi=zJsFjbrZrpj-E65T49ewgqdia+MOPnqmgx5KW-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-16 18:03     ` Eli Cohen
2010-11-16 16:11 ` Roland Dreier
     [not found]   ` <ada62vxl046.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-11-16 18:07     ` Eli Cohen
2010-11-16 22:43       ` Roland Dreier
     [not found]         ` <ada1v6klwil.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-11-17  9:01           ` Eli Cohen
2010-11-17 17:38             ` Roland Dreier
     [not found]               ` <adasjyzkfyw.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-11-18  6:51                 ` Eli Cohen
2010-11-25  7:13                   ` Aleksey Senin
     [not found]                     ` <AANLkTinN43YgQW3ftbng-4f2NiNe9_oXPVCX5LPzh7uG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-25  8:36                       ` Or Gerlitz
     [not found]                         ` <4CEE200B.70106-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-11-25  8:56                           ` Alekseys Senin
     [not found]                             ` <1290675387.4050.51.camel-uOVkuFIEnOODI2cvxHXf6UEOCMrvLtNR@public.gmane.org>
2010-11-28 13:50                               ` Aleksey Senin
     [not found]                                 ` <AANLkTikWrQRcA62bkM=1zWQuyH6nABSvqnbAeaAjfgcP-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-29 17:34                                   ` Roland Dreier
     [not found]                                     ` <adafwukf2yy.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-11-30 11:07                                       ` Aleksey Senin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101115140829.GA20355@mtldesk30 \
    --to=eli-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox