aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/shm.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-10-05 17:36:38 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-10-05 17:36:38 -0700
commit7b415285ae96f5bfa0fa95d3227c6900c4ff151d (patch)
treefeb5198f57bfb5b58aca24ddc76a313236f94512 /ipc/shm.c
parentc65cf815653ec64e73d40819806c2d1aed91681e (diff)
parent049e6dde7e57f0054fdc49102e7ef4830c698b46 (diff)
downloadlinux-7b415285ae96f5bfa0fa95d3227c6900c4ff151d.tar.gz
Merge tag 'v4.3-rc4' into next
Merge with mainline to sync up with changes to parkbd driver.
Diffstat (limited to 'ipc/shm.c')
-rw-r--r--ipc/shm.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 222131e8e38f..41787276e141 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -551,12 +551,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;
@@ -565,6 +559,13 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
shp->shm_nattch = 0;
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;
+ }
+
list_add(&shp->shm_clist, &current->sysvshm.shm_clist);
/*