gpu: nvgpu: Fix Unused value Defect

Fix following Coverity Defect:
nvgpu_init.c : Unused value

The ret variable was being reassigned the error code from
nvgpu_cic_mon_deinit(g) without taking into account the previous ret value.
We need to propagate whether there is an error
(the last known error is returned) or not using ret, the temp_ret
variable helps in verifying this.
Similar coding style followed in the entire function.

CID 10127863

Bug 3460991

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I732ba5269ebbbe68f113e53229df40ae49ccc13c
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2697104
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jinesh Parakh
2022-04-14 00:04:40 +05:30
committed by mobile promotions
parent 60481ea5e4
commit 167e7b0256

View File

@@ -394,8 +394,9 @@ int nvgpu_prepare_poweroff(struct gk20a *g)
* This will ensure that CIC will not get probed * This will ensure that CIC will not get probed
* after it's deinit. * after it's deinit.
*/ */
ret = nvgpu_cic_mon_deinit(g); tmp_ret = nvgpu_cic_mon_deinit(g);
if (ret != 0) { if (tmp_ret != 0) {
ret = tmp_ret;
nvgpu_err(g, "Failed to deinit CIC-mon."); nvgpu_err(g, "Failed to deinit CIC-mon.");
} }