From 69e0393a0e1eb8b30adda89a79556499b0c5cb82 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 27 Jun 2016 14:37:11 -0700 Subject: gpu: nvgpu: kmalloc does not return error codes kmalloc() returns NULL instead of error code on failure. Do not check if the return value is an error code. Change-Id: I31a46080ab51773a22bebe4cf03a5b0c94467204 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1172052 --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 4a3d58cb..9790af05 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -6629,7 +6629,7 @@ int gr_gk20a_get_ctx_buffer_offsets(struct gk20a *g, return -ENODEV; priv_registers = kzalloc(sizeof(u32) * potential_offsets, GFP_KERNEL); - if (IS_ERR_OR_NULL(priv_registers)) { + if (!priv_registers) { gk20a_dbg_fn("failed alloc for potential_offsets=%d", potential_offsets); err = PTR_ERR(priv_registers); goto cleanup; -- cgit v1.2.2