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>
This commit is contained in:
Terje Bergstrom
2016-12-20 14:38:53 -08:00
committed by mobile promotions
parent 2958db6f56
commit b6031e4e15

View File

@@ -1573,7 +1573,7 @@ static int channel_gk20a_alloc_job(struct channel_gk20a *c,
} else {
*job_out = kzalloc(sizeof(struct channel_gk20a_job),
GFP_KERNEL);
if (!job_out)
if (!*job_out)
err = -ENOMEM;
}