Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753176AbaBZXHT (ORCPT ); Wed, 26 Feb 2014 18:07:19 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:54119 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbaBZXHR (ORCPT ); Wed, 26 Feb 2014 18:07:17 -0500 Date: Wed, 26 Feb 2014 15:07:14 -0800 From: Kent Overstreet To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Jens Axboe , "Nicholas A. Bellinger" Subject: Re: [PATCH RESEND 3/3] percpu_ida: Sanity check initialization parameters Message-ID: <20140226230714.GF11655@kmo> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 06, 2014 at 01:24:55PM +0100, Alexander Gordeev wrote: > Signed-off-by: Alexander Gordeev > Cc: Kent Overstreet > Cc: Peter Zijlstra > Cc: Jens Axboe > Cc: "Nicholas A. Bellinger" > --- > lib/percpu_ida.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/lib/percpu_ida.c b/lib/percpu_ida.c > index c2fa3dc..81b5ae9 100644 > --- a/lib/percpu_ida.c > +++ b/lib/percpu_ida.c > @@ -305,6 +305,11 @@ int __percpu_ida_init(struct percpu_ida *pool, unsigned long nr_tags, > { > unsigned i, cpu, order; > > + if (batch_size > max_size) > + return -ERANGE; > + if (!batch_size) > + return -EINVAL; > + > memset(pool, 0, sizeof(*pool)); > > init_waitqueue_head(&pool->wait); Acked-by: Kent Overstreet -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/