From b6031e4e15f4afe4bed9965ecca1e2cf6d08342e Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 20 Dec 2016 14:38:53 -0800 Subject: 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 Reviewed-on: http://git-master/r/1275741 GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a') 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, } else { *job_out = kzalloc(sizeof(struct channel_gk20a_job), GFP_KERNEL); - if (!job_out) + if (!*job_out) err = -ENOMEM; } -- cgit v1.2.2