Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f66d45e99eb7ca91822c3e3f6d7a98843c9626cb
Commit:     f66d45e99eb7ca91822c3e3f6d7a98843c9626cb
Parent:     821836e5baa69b8bc80605f25ad963e721609bc0
Author:     Guy Streeter <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 23 12:20:04 2007 -0600
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jan 23 11:18:50 2007 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
    --
---
 ipc/shm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ipc/shm.c b/ipc/shm.c
index 6d16bb6..f8e10a2 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));
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to