diff options
author | Guy Streeter <guy.streeter@gmail.com> | 2007-01-23 19:20:04 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-01-23 20:18:50 +0100 |
commit | f66d45e99eb7ca91822c3e3f6d7a98843c9626cb (patch) | |
tree | ce796ff749980d7c3d08c0d42f63d25d42416e49 /ipc/shm.c | |
parent | Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/rolan... (diff) | |
download | linux-f66d45e99eb7ca91822c3e3f6d7a98843c9626cb.tar.xz linux-f66d45e99eb7ca91822c3e3f6d7a98843c9626cb.zip |
[PATCH] correct sys_shmget allocation check
As written, sys_shmget will return ENOSPC when one page is still
available for allocation. This patch corrects the test.
Signed-off-by: Guy Streeter <guy.streeter+lkml@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
--
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipc/shm.c b/ipc/shm.c index 6d16bb6de7d2..f8e10a25ad7d 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -279,7 +279,7 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) if (size < SHMMIN || size > ns->shm_ctlmax) return -EINVAL; - if (ns->shm_tot + numpages >= ns->shm_ctlall) + if (ns->shm_tot + numpages > ns->shm_ctlall) return -ENOSPC; shp = ipc_rcu_alloc(sizeof(*shp)); |