Signed-off-by: Alexander Gordeev <agord...@redhat.com> Cc: Kent Overstreet <k...@daterainc.com> Cc: Peter Zijlstra <pet...@infradead.org> Cc: Jens Axboe <ax...@kernel.dk> Cc: "Nicholas A. Bellinger" <n...@linux-iscsi.org> Acked-by: Kent Overstreet <k...@daterainc.com> --- 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 472ff08..f474f03 100644 --- a/lib/percpu_ida.c +++ b/lib/percpu_ida.c @@ -293,6 +293,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); -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/