Commit c8d60033 authored by Manfred Spraul's avatar Manfred Spraul Committed by Linus Torvalds

[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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bab5f4f1
......@@ -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:
if (mq_sysctl_table)
unregister_sysctl_table(mq_sysctl_table);
out_cache:
if (kmem_cache_destroy(mqueue_inode_cachep)) {
printk(KERN_INFO
"mqueue_inode_cache: not all structures were freed\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment