Skip to content

Commit

Permalink
Merge branch '2020-11-20/fix-mig-segfault' into 'master'
Browse files Browse the repository at this point in the history
Honor OPT_NO_CGROUPS in nvc_device_mig_caps_mount

See merge request nvidia/container-toolkit/libnvidia-container!43
  • Loading branch information
klueska committed Nov 20, 2020
2 parents f4330c7 + 91c0407 commit 31674b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nvc_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,9 @@ nvc_device_mig_caps_mount(struct nvc_context *ctx, const struct nvc_container *c
// Check if NV_CAPS_MODULE_NAME exists as a major device, and if so,
// mount in the appropriate /dev based capabilities as devices.
if ((nvcaps_major = nvidia_get_chardev_major(NV_CAPS_MODULE_NAME)) != -1) {
if (setup_mig_minor_cgroups(&ctx->err, cnt, nvcaps_major, &dev->node) < 0)
goto fail;
if (!(cnt->flags & OPT_NO_CGROUPS))
if (setup_mig_minor_cgroups(&ctx->err, cnt, nvcaps_major, &dev->node) < 0)
goto fail;
}

// Set the return value to indicate success.
Expand Down

0 comments on commit 31674b9

Please sign in to comment.