Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / dma-buf / dma-resv.c
index bb5a42b..6ddbeb5 100644 (file)
@@ -200,7 +200,7 @@ int dma_resv_reserve_shared(struct dma_resv *obj, unsigned int num_fences)
                        max = max(old->shared_count + num_fences,
                                  old->shared_max * 2);
        } else {
-               max = 4;
+               max = max(4ul, roundup_pow_of_two(num_fences));
        }
 
        new = dma_resv_list_alloc(max);