Skip to content

Commit c95f17c

Browse files
committed
Fix Coverity defect #1457196
1 parent 065902c commit c95f17c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nvc_mount.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ nvc_device_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const
403403
if (nsenter(&ctx->err, cnt->mnt_ns, CLONE_NEWNS) < 0)
404404
return (-1);
405405

406-
if ((proc_mnt = mount_procfs_gpu(&ctx->err, cnt, dev->busid)) == NULL)
407-
goto fail;
408406
if (!(cnt->flags & OPT_NO_DEVBIND)) {
409407
if (xstat(&ctx->err, dev->node.path, &s) < 0)
410408
return (-1);
@@ -415,6 +413,8 @@ nvc_device_mount(struct nvc_context *ctx, const struct nvc_container *cnt, const
415413
if ((dev_mnt = mount_device(&ctx->err, cnt, dev->node.path)) == NULL)
416414
goto fail;
417415
}
416+
if ((proc_mnt = mount_procfs_gpu(&ctx->err, cnt, dev->busid)) == NULL)
417+
goto fail;
418418
if (!(cnt->flags & OPT_NO_CGROUPS)) {
419419
if (setup_cgroup(&ctx->err, cnt->dev_cg, dev->node.id) < 0)
420420
goto fail;

0 commit comments

Comments
 (0)