gpu: nvgpu: Fix Unchecked Return Value bugs

Propagate errors from previously unchecked function calls.
This fixes the following Coverity Defects:

nvlink.c : Unchecked return value
sysfs.c : Unchecked return value
nvlink_probe.c : Unchecked return value
ioctl_nvs.c : Unchecked return value

CID 9847567
CID 9848580
CID 10127940
CID 10129447

Bug 3460991
Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I930bf34a451d6d941359ad76c84cf1fef2df1351
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2689111
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jinesh Parakh
2022-03-29 15:15:09 +05:30
committed by mobile promotions
parent 120a653dd1
commit 02b108d26d
4 changed files with 71 additions and 18 deletions

View File

@@ -588,7 +588,15 @@ static ssize_t mscg_enable_store(struct device *dev,
smp_mb();
g->mscg_enabled = false;
if (nvgpu_pg_elpg_is_enabled(g)) {
nvgpu_pg_elpg_enable(g);
err = nvgpu_pg_elpg_enable(g);
if (err) {
WRITE_ONCE(pmu->pg->mscg_stat, PMU_MSCG_ENABLED);
/* make status visible */
smp_mb();
g->mscg_enabled = true;
gk20a_idle(g);
return err;
}
}
}
g->mscg_enabled = false;