X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=ipc%2Fshm.c;h=08b14f69d6cfdb2176c56c431a2ba3e5d25d0fd0;hb=45081e2bc5c895729cae87972b4b86957c178036;hp=6dc55af8a29b4b154534c87d7d2b2b6fb0682aa0;hpb=bda15ed54357438acac98d7183a5f048c7b867b1;p=firefly-linux-kernel-4.4.55.git diff --git a/ipc/shm.c b/ipc/shm.c index 6dc55af8a29b..08b14f69d6cf 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -544,12 +544,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) if (IS_ERR(file)) goto no_file; - id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); - if (id < 0) { - error = id; - goto no_id; - } - shp->shm_cprid = task_tgid_vnr(current); shp->shm_lprid = 0; shp->shm_atim = shp->shm_dtim = 0; @@ -559,6 +553,12 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) shp->shm_file = file; shp->shm_creator = current; + id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); + if (id < 0) { + error = id; + goto no_id; + } + /* * shmid gets reported as "inode#" in /proc/pid/maps. * proc-ps tools use this. Changing this will break them.