gpu: nvgpu: tsg: release default nvs domain ref

A reference to the default scheduling domain is taken when a TSG is
opened. Although the explicit bind is designed to support only one bind,
the TSG is bound to the default one implicitly at that point. Release
the reference to avoid leaking it.

The domain might be null at that point if the default domain has been
removed; in that case there's just no domain to put back.

Change-Id: I7db43f7bbb2a8c86c391280eb7fa32431c8982da
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2663420
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Konsta Hölttä
2022-02-03 11:45:42 +02:00
committed by mobile promotions
parent 8736c0d467
commit 359e83b45a

View File

@@ -188,6 +188,11 @@ int nvgpu_tsg_bind_domain(struct nvgpu_tsg *tsg, u64 domain_id)
return -ENOENT;
}
/* Release the default domain ref that was implicitly taken at open */
if (tsg->nvs_domain != NULL) {
nvgpu_nvs_domain_put(g, tsg->nvs_domain);
}
tsg->rl_domain = rl_domain;
tsg->nvs_domain = nvs_domain;