diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_allocator.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c index b6549cee..3694c96d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c | |||
@@ -604,10 +604,11 @@ static struct gk20a_buddy *__balloc_find_buddy(struct gk20a_allocator *a, | |||
604 | static u64 __balloc_do_alloc(struct gk20a_allocator *a, u64 order, int pte_size) | 604 | static u64 __balloc_do_alloc(struct gk20a_allocator *a, u64 order, int pte_size) |
605 | { | 605 | { |
606 | u64 split_order; | 606 | u64 split_order; |
607 | struct gk20a_buddy *bud; | 607 | struct gk20a_buddy *bud = NULL; |
608 | 608 | ||
609 | split_order = order; | 609 | split_order = order; |
610 | while (!(bud = __balloc_find_buddy(a, split_order, pte_size))) | 610 | while (split_order <= a->max_order && |
611 | !(bud = __balloc_find_buddy(a, split_order, pte_size))) | ||
611 | split_order++; | 612 | split_order++; |
612 | 613 | ||
613 | /* Out of memory! */ | 614 | /* Out of memory! */ |