X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fsvm%2Fssvm.c;h=dfb68c039add5b4684b8ba13bddc63432a509ce6;hb=65784c1602c7c8171effd00384f65f546d93a13b;hp=04e0efa3d622d76f0944135b34b1fe9ccbe30ac8;hpb=01a771b12198b3f07d67a4bc73650c1f65257708;p=vpp.git diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c index 04e0efa3d62..dfb68c039ad 100644 --- a/src/svm/ssvm.c +++ b/src/svm/ssvm.c @@ -29,7 +29,6 @@ int ssvm_master_init_shm (ssvm_private_t * ssvm) { int ssvm_fd, mh_flags = MHEAP_FLAG_DISABLE_VM | MHEAP_FLAG_THREAD_SAFE; - svm_main_region_t *smr = svm_get_root_rp ()->data_base; clib_mem_vm_map_t mapa = { 0 }; u8 junk = 0, *ssvm_filename; ssvm_shared_header_t *sh; @@ -56,8 +55,13 @@ ssvm_master_init_shm (ssvm_private_t * ssvm) if (fchmod (ssvm_fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) < 0) clib_unix_warning ("ssvm segment chmod"); - if (fchown (ssvm_fd, smr->uid, smr->gid) < 0) - clib_unix_warning ("ssvm segment chown"); + if (svm_get_root_rp ()) + { + /* TODO: is this really needed? */ + svm_main_region_t *smr = svm_get_root_rp ()->data_base; + if (fchown (ssvm_fd, smr->uid, smr->gid) < 0) + clib_unix_warning ("ssvm segment chown"); + } if (lseek (ssvm_fd, ssvm->ssvm_size, SEEK_SET) < 0) {