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 <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291684
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Terje Bergstrom
2017-01-19 15:40:49 -08:00
committed by mobile promotions
parent 8fa68aeb04
commit 52ecd593c2

View File

@@ -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;
}