aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2004-08-23 21:27:43 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-23 21:27:43 -0700
commitfefd81e1513d6871ffe209a53003c06be6e760da (patch)
tree9c0e69575ccb1debce2c73e4f5ac2af0215478f0 /ipc
parent11c61286f67647491bda3398903f07929e74fe28 (diff)
downloadhistory-fefd81e1513d6871ffe209a53003c06be6e760da.tar.gz
[PATCH] remove magic +1 from shm segment count
Michael Kerrisk found a bug in the shm accounting code: sysv shm allows to create SHMMNI+1 shared memory segments, instead of SHMMNI segments. The +1 is probably from the first shared anonymous mapping implementation that used the sysv code to implement shared anon mappings. The implementation got replaced, it's now the other way around (sysv uses the shared anon code), but the +1 remained. Signed-off-by: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/shm.c b/ipc/shm.c
index 55dc1ba4229e1f..31a925745c25d9 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -78,7 +78,7 @@ static inline struct shmid_kernel *shm_rmid(int id)
static inline int shm_addid(struct shmid_kernel *shp)
{
- return ipc_addid(&shm_ids, &shp->shm_perm, shm_ctlmni+1);
+ return ipc_addid(&shm_ids, &shp->shm_perm, shm_ctlmni);
}