diff options
author | Anton Kondratenko <akondratenko@nvidia.com> | 2012-04-17 13:52:42 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-24 13:59:34 -0700 |
commit | 76191dd9546c6cf1b2a574272fc106141b4acb31 (patch) | |
tree | 8f75de95314ea7d3794c1e27d64b686f89ec9c74 | |
parent | fbfd93a5d14f4eda665f56b748da037b8194b1d3 (diff) |
kernel: nvhost: add OOM checks
This change adds check for out of memory conditions
after memory allocations
Bug 967504
Change-Id: Icafc16528880ea376dd69a023570b85c25e3d057
Signed-off-by: Anton Kondratenko <akondratenko@nvidia.com>
Reviewed-on: http://git-master/r/97113
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/video/tegra/host/nvhost_job.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/nvhost_job.c b/drivers/video/tegra/host/nvhost_job.c index df7a62d689bc..a4f0cfc44212 100644 --- a/drivers/video/tegra/host/nvhost_job.c +++ b/drivers/video/tegra/host/nvhost_job.c @@ -73,7 +73,7 @@ static int alloc_gathers(struct nvhost_job *job, gather_size(num_cmdbufs), 32, NVMAP_HANDLE_CACHEABLE, 0); if (IS_ERR_OR_NULL(job->gather_mem)) { - err = PTR_ERR(job->gather_mem); + err = job->gather_mem ? PTR_ERR(job->gather_mem) : -ENOMEM; job->gather_mem = NULL; goto error; } @@ -82,7 +82,7 @@ static int alloc_gathers(struct nvhost_job *job, /* Map memory to kernel */ job->gathers = nvmap_mmap(job->gather_mem); if (IS_ERR_OR_NULL(job->gathers)) { - err = PTR_ERR(job->gathers); + err = job->gathers ? PTR_ERR(job->gathers) : -ENOMEM; job->gathers = NULL; goto error; } |