mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] correct sys_shmget allocation check
@ 2007-01-23 18:20 Guy Streeter
  0 siblings, 0 replies; only message in thread
From: Guy Streeter @ 2007-01-23 18:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds

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>

--

Index: linux-2.6/ipc/shm.c
===================================================================
--- linux-2.6.orig/ipc/shm.c
+++ linux-2.6/ipc/shm.c
@@ -279,7 +279,7 @@ static int newseg (struct ipc_namespace
       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));

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-23 18:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 18:20 [PATCH] correct sys_shmget allocation check Guy Streeter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®