Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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>
--

authored by

Guy Streeter and committed by
Linus Torvalds
f66d45e9 821836e5

+1 -1
+1 -1
ipc/shm.c
··· 279 279 if (size < SHMMIN || size > ns->shm_ctlmax) 280 280 return -EINVAL; 281 281 282 - if (ns->shm_tot + numpages >= ns->shm_ctlall) 282 + if (ns->shm_tot + numpages > ns->shm_ctlall) 283 283 return -ENOSPC; 284 284 285 285 shp = ipc_rcu_alloc(sizeof(*shp));