public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: sebastien dugue <sebastien.dugue-6ktuUTfB/bM@public.gmane.org>
To: Or Gerlitz <or.gerlitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-next 3/6] IB/mlx4: Fix parameter checking in create_cq
Date: Fri, 11 May 2012 10:15:16 +0200	[thread overview]
Message-ID: <20120511101516.2d4b9274@b012350-ux> (raw)
In-Reply-To: <CAJZOPZLYp87tgMOBmaJGA4VqdH_t6=jAVr1o=Q7RJuVYZNethw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, 11 May 2012 10:39:12 +0300
Or Gerlitz <or.gerlitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> sebastien dugue <sebastien.dugue-6ktuUTfB/bM@public.gmane.org> wrote:
> > > @@ -172,6 +172,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device
> > > *ibdev, int entries, int vector
> > >       struct mlx4_uar *uar;
> > >       int err;
> > >
> > > +     entries      = roundup_pow_of_two(entries + 1);
> > >       if (entries < 1 || entries > dev->dev->caps.max_cqes)
> >
> >  Is the first check still needed here then?
> 
> not really, good catch - unless we need to protect here from negative
> values coming
> e.g from user space, I'll look this up,  thanks
> 
> Or.
> 
> Or.


  A small test shows that for n < 2, we have roundup_pow_of_two(n) == 1. But
this is with the current implementation and on x86_64, so maybe on other
architectures the test may still be needed after all.


  Sébastien.
--
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

  parent reply	other threads:[~2012-05-11  8:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 20:28 [PATCH for-next 0/6] IB: 2nd batch of fixes for 3.5 Or Gerlitz
     [not found] ` <1336681689-16668-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-10 20:28   ` [PATCH for-next V1 1/6] net/mlx4_core: Change bitmap allocator to work in round-robin fashion Or Gerlitz
     [not found]     ` <1336681689-16668-2-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-14 20:44       ` Roland Dreier
2012-05-10 20:28   ` [PATCH for-next 2/6] IB/core: fix mismatch between locked and pinned pages Or Gerlitz
     [not found]     ` <1336681689-16668-3-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-10 20:38       ` Christoph Lameter
2012-05-11 17:06       ` Christoph Lameter
     [not found]         ` <alpine.DEB.2.00.1205111205530.31049-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2012-05-11 18:38           ` Roland Dreier
     [not found]             ` <CAL1RGDWVQuhSWkK1qK98Ar6YrsL02_m9kkAY4pDFaCqhMyHKiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-13  7:11               ` Or Gerlitz
2012-05-10 20:28   ` [PATCH for-next 3/6] IB/mlx4: Fix parameter checking in create_cq Or Gerlitz
     [not found]     ` <1336681689-16668-4-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-11  7:10       ` sebastien dugue
2012-05-11  7:39         ` Or Gerlitz
     [not found]           ` <CAJZOPZLYp87tgMOBmaJGA4VqdH_t6=jAVr1o=Q7RJuVYZNethw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-11  8:15             ` sebastien dugue [this message]
2012-05-10 20:28   ` [PATCH for-next 4/6] IB/core: Fix IB_SA_COMP_MASK macro Or Gerlitz
     [not found]     ` <1336681689-16668-5-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-19  0:16       ` Roland Dreier
2012-05-10 20:28   ` [PATCH for-next 5/6] net/mlx4: Adjust initial value of vl_cap in mlx4_SET_PORT Or Gerlitz
     [not found]     ` <1336681689-16668-6-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-19  0:40       ` Roland Dreier
     [not found]         ` <CAL1RGDUjNrRnU2_cfbdJd790K9oLD+rRFQDOyR6eX-3R1tWbQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-20 11:21           ` Or Gerlitz
     [not found]             ` <4FB8D3C0.7040603-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-21 16:14               ` Roland Dreier
2012-05-21 10:15           ` Or Gerlitz
2012-05-10 20:28   ` [PATCH for-next 6/6] IB/mlx4: bug fix for mlx4_ib_add error flow Or Gerlitz
     [not found]     ` <1336681689-16668-7-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-05-19  0:45       ` Roland Dreier

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=20120511101516.2d4b9274@b012350-ux \
    --to=sebastien.dugue-6ktuutfb/bm@public.gmane.org \
    --cc=eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=or.gerlitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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