gpu: nvgpu: fix malloc in POSIX dma module

This fixes a bug where the POSIX dma module was calling malloc for
dma allocation requests with the incorrect size.

Bug found as a result of JIRA NVGPU-1235

Change-Id: Ia2933dc90f12d84a7da91a50eb3eafd6eb0e129e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1930799
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2018-10-16 15:24:44 -04:00
committed by mobile promotions
parent 2597c61886
commit bd95a0c5ff

View File

@@ -38,7 +38,7 @@ static int __nvgpu_do_dma_alloc(struct gk20a *g, unsigned long flags,
size_t size, struct nvgpu_mem *mem, size_t size, struct nvgpu_mem *mem,
enum nvgpu_aperture ap) enum nvgpu_aperture ap)
{ {
void *memory = malloc(mem->aligned_size); void *memory = malloc(PAGE_ALIGN(size));
if (memory == NULL) if (memory == NULL)
return -ENOMEM; return -ENOMEM;