X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ipc%2Fshm.c;h=02ecf2c078fce9b62ee2b1ec0ef252c0320acdf5;hb=29c6a01df8de1329303da09ca9793e9f65608216;hp=7efff043ffbf48a964f5dc5e7284c6dc9d9c507c;hpb=33a30ed4bdccd95ed84a1a20c1fef8ac89788ce5;p=pandora-kernel.git diff --git a/ipc/shm.c b/ipc/shm.c index 7efff043ffbf..02ecf2c078fc 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -105,9 +105,16 @@ void shm_exit_ns(struct ipc_namespace *ns) } #endif -void __init shm_init (void) +static int __init ipc_ns_init(void) { shm_init_ns(&init_ipc_ns); + return 0; +} + +pure_initcall(ipc_ns_init); + +void __init shm_init (void) +{ ipc_init_proc_interface("sysvipc/shm", #if BITS_PER_LONG <= 32 " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime rss swap\n", @@ -304,6 +311,9 @@ void exit_shm(struct task_struct *task) { struct ipc_namespace *ns = task->nsproxy->ipc_ns; + if (shm_ids(ns).in_use == 0) + return; + /* Destroy all already created segments, but not mapped yet */ down_write(&shm_ids(ns).rw_mutex); if (shm_ids(ns).in_use)