diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_allocator.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_allocator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c index 32c003b6..d836dbcf 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c | |||
@@ -922,7 +922,8 @@ int gk20a_allocator_block_alloc(struct gk20a_allocator *allocator, | |||
922 | 922 | ||
923 | allocator_dbg(allocator, "[in] addr %d, len %d", *addr, len); | 923 | allocator_dbg(allocator, "[in] addr %d, len %d", *addr, len); |
924 | 924 | ||
925 | if (*addr + len > allocator->limit || /* check addr range */ | 925 | if ((*addr != 0 && *addr < allocator->base) || /* check addr range */ |
926 | *addr + len > allocator->limit || /* check addr range */ | ||
926 | *addr & (allocator->align - 1) || /* check addr alignment */ | 927 | *addr & (allocator->align - 1) || /* check addr alignment */ |
927 | len == 0) /* check len */ | 928 | len == 0) /* check len */ |
928 | return -EINVAL; | 929 | return -EINVAL; |