From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] kernel-2.6.9: make sock_init() notice errors
Date: Sat, 27 Nov 2004 16:26:16 +0000 [thread overview]
Message-ID: <41A8AAA8.6070905@bfs.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1243 bytes --]
Hi list,
by accident i found that that sock_init never checks the return code of
called init functions. I have no idea why this is not done so i added
only a printk() to inform the user about the problem.
The function returns no error indicator. i left it this way.
re,
walter
Signed-off-by: walter harms <wharms@bfs.de>
--- linux-2.6.9/net/socket.c.bak 2004-11-26 23:55:03.000000000 +0100
+++ linux-2.6.9/net/socket.c 2004-11-27 00:21:25.000000000 +0100
@@ -2032,6 +2032,7 @@
void __init sock_init(void)
{
int i;
+ int ret;
/*
* Initialize all address (protocol) families.
@@ -2057,9 +2058,26 @@
* Initialize the protocols module.
*/
- init_inodecache();
- register_filesystem(&sock_fs_type);
+ ret=init_inodecache();
+ if ( ret < 0 ) {
+ printk(KERN_CRIT "%s : init_inodecache failed\n",__FUNCTION__);
+ return;
+ }
+
+ ret=register_filesystem(&sock_fs_type);
+
+ if ( ret < 0 ) {
+ printk(KERN_CRIT "%s : can not register sock_fs\n",__FUNCTION__);
+ return;
+ }
+
+
sock_mnt = kern_mount(&sock_fs_type);
+ if (IS_ERR(sock_mnt)) {
+ printk(KERN_CRIT "%s : can not mount sock_fs\n",__FUNCTION__);
+ return;
+ }
+
/* The real protocol initialization is performed when
* do_initcalls is run.
*/
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
reply other threads:[~2004-11-27 16:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41A8AAA8.6070905@bfs.de \
--to=wharms@bfs.de \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.