mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: posix: Init enabled flags in nvgpu_posix_probe()
Also clean up the code a bit to be more MISRA friendly. Although this isn't necessary it does help reduce false positives in the various scans. JIRA NVGPU-1323 Change-Id: I89a857ff69cc7669990bff942011ef1e11500327 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1941536 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Scott Long <scottl@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Philip Elcan <pelcan@nvidia.com> Reviewed-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
e369b055b3
commit
7dee2d41b7
@@ -30,6 +30,7 @@
|
||||
#include <nvgpu/nvgpu_common.h>
|
||||
#include <nvgpu/os_sched.h>
|
||||
#include <nvgpu/gk20a.h>
|
||||
#include <nvgpu/enabled.h>
|
||||
|
||||
#include <nvgpu/posix/probe.h>
|
||||
|
||||
@@ -117,23 +118,29 @@ struct gk20a *nvgpu_posix_probe(void)
|
||||
{
|
||||
struct gk20a *g;
|
||||
struct nvgpu_os_posix *p;
|
||||
int err;
|
||||
|
||||
p = malloc(sizeof(*p));
|
||||
if (p == NULL)
|
||||
if (p == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g = &p->g;
|
||||
|
||||
g->log_mask = 0;
|
||||
g->mm.g = g;
|
||||
|
||||
err = nvgpu_kmem_init(g);
|
||||
if (err != 0)
|
||||
goto fail;
|
||||
if (nvgpu_kmem_init(g) != 0) {
|
||||
goto fail_kmem;
|
||||
}
|
||||
|
||||
if (nvgpu_init_enabled_flags(g) != 0) {
|
||||
goto fail_enabled_flags;
|
||||
}
|
||||
|
||||
return g;
|
||||
|
||||
fail:
|
||||
fail_enabled_flags:
|
||||
nvgpu_kmem_fini(g, 0);
|
||||
fail_kmem:
|
||||
free(p);
|
||||
|
||||
return NULL;
|
||||
@@ -144,5 +151,6 @@ void nvgpu_posix_cleanup(struct gk20a *g)
|
||||
struct nvgpu_os_posix *p = nvgpu_os_posix_from_gk20a(g);
|
||||
|
||||
nvgpu_kmem_fini(g, 0);
|
||||
nvgpu_free_enabled_flags(g);
|
||||
free(p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user