IB: Fix ib_umem_get() when npages == 0
[safe/jmp/linux-2.6] / drivers / infiniband / core / umem.c
index d40652a..26d0470 100644 (file)
@@ -121,6 +121,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
 
        cur_base = addr & PAGE_MASK;
 
+       ret = 0;
        while (npages) {
                ret = get_user_pages(current, current->mm, cur_base,
                                     min_t(int, npages,