From 52ecd593c2fca21bd9d7e88f85267db10b88ceb5 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 19 Jan 2017 15:40:49 -0800 Subject: gpu: nvgpu: Skip checking for null in error path clk_prog_construct_1x_master_table() first constructs boardobj and then allocates further structures. If the further allocation fails, it calls exit label. The exit label checks if boardobj is NULL and calls destructor if it is. As there is no path to get to exit label with boardobj NULL, skip the check. Coverity ID 2011367 Change-Id: Ic157397ca42d26b7640f7b28f6a9fb929d517412 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1291684 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/clk/clk_prog.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/clk/clk_prog.c b/drivers/gpu/nvgpu/clk/clk_prog.c index b8c8d9a2..4135f767 100644 --- a/drivers/gpu/nvgpu/clk/clk_prog.c +++ b/drivers/gpu/nvgpu/clk/clk_prog.c @@ -718,10 +718,9 @@ static u32 clk_prog_construct_1x_master_table(struct gk20a *g, memcpy(pclkprog->p_slave_entries, ptmpprog->p_slave_entries, slavesize); exit: - if (status) { - if (*ppboardobj != NULL) - (*ppboardobj)->destruct(*ppboardobj); - } + if (status) + (*ppboardobj)->destruct(*ppboardobj); + return status; } -- cgit v1.2.2