aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2004-10-27 18:34:43 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-27 18:34:43 -0700
commitc8d6003375f696537f2a8cb518dbf86cc93e4f02 (patch)
tree548d463fabf356ca0c918d1b5ee24bdb7b5a5233 /ipc
parentbab5f4f191d3e90974c0544ec7c1efd72acc0724 (diff)
downloadhistory-c8d6003375f696537f2a8cb518dbf86cc93e4f02.tar.gz
[PATCH] handle posix message queues with /proc/sys disabled
register_sysctl_table() fails if sysctl support is not compiled into the kernel. The POSIX message queue subsystem aborted it's initialization if register_sysctl_table() fails, and that causes an oops in sys_mq_open(). The patch fixes that by ignoring failures from register_sysctl_table(). Signed-off-by; Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mqueue.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 71634b6a08fdad..cb0cd3cf3b5a5d 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1219,11 +1219,8 @@ static int __init init_mqueue_fs(void)
if (mqueue_inode_cachep == NULL)
return -ENOMEM;
+ /* ignore failues - they are not fatal */
mq_sysctl_table = register_sysctl_table(mq_sysctl_root, 0);
- if (!mq_sysctl_table) {
- error = -ENOMEM;
- goto out_cache;
- }
error = register_filesystem(&mqueue_fs_type);
if (error)
@@ -1243,8 +1240,8 @@ static int __init init_mqueue_fs(void)
out_filesystem:
unregister_filesystem(&mqueue_fs_type);
out_sysctl:
- unregister_sysctl_table(mq_sysctl_table);
-out_cache:
+ if (mq_sysctl_table)
+ unregister_sysctl_table(mq_sysctl_table);
if (kmem_cache_destroy(mqueue_inode_cachep)) {
printk(KERN_INFO
"mqueue_inode_cache: not all structures were freed\n");