diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-12-20 17:38:53 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-04 04:44:23 -0500 |
commit | b6031e4e15f4afe4bed9965ecca1e2cf6d08342e (patch) | |
tree | 5809e51f644b6b8b0466a268e25b3d3e18cb5642 | |
parent | 2958db6f5625a9f566644a6830dc96e1b6879327 (diff) |
gpu: nvgpu: Check for NULL in job allocation
When allocating job channel_gk20a_job structure we assign the result
of allocation to *job_out, but we check the result of allocation
in job_out.
Change the check to check for result in *job_out.
Change-Id: Ia170cfa2dd5730665434b4c223c5a2f9502c744d
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1275741
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 38cb368c..26285729 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1573,7 +1573,7 @@ static int channel_gk20a_alloc_job(struct channel_gk20a *c, | |||
1573 | } else { | 1573 | } else { |
1574 | *job_out = kzalloc(sizeof(struct channel_gk20a_job), | 1574 | *job_out = kzalloc(sizeof(struct channel_gk20a_job), |
1575 | GFP_KERNEL); | 1575 | GFP_KERNEL); |
1576 | if (!job_out) | 1576 | if (!*job_out) |
1577 | err = -ENOMEM; | 1577 | err = -ENOMEM; |
1578 | } | 1578 | } |
1579 | 1579 | ||