All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] hamradio/bpqether.c: check return value of
Date: Thu, 02 Feb 2006 13:35:22 +0000	[thread overview]
Message-ID: <43E20A9A.2070007@bfs.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

check the return value of register_netdevice_notifier()


also as attachment if something mangels the layout.
compile tested
Signed-off-by: walter harms <wharms@bfs.de>

--- linux/drivers/net/hamradio/bpqether.c.bak	2006-02-01 
22:13:07.000000000 +0100
+++ linux/drivers/net/hamradio/bpqether.c	2006-02-01 22:30:16.000000000 
+0100
@@ -595,6 +595,7 @@
   */
  static int __init bpq_init_driver(void)
  {
+	int ret;
  #ifdef CONFIG_PROC_FS
  	if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) {
  		printk(KERN_ERR
@@ -605,7 +606,12 @@

  	dev_add_pack(&bpq_packet_type);

-	register_netdevice_notifier(&bpq_dev_notifier);
+	ret = register_netdevice_notifier(&bpq_dev_notifier);
+	if (ret < 0) {
+		printk( KERN_WARNING "register_netdevice_notifier failed in 
%s\n",__FUNCTION__);
+		dev_remove_pack(&bpq_packet_type);
+		return -1;
+	}

  	printk(banner);


[-- Attachment #2: bpqether.c.diff --]
[-- Type: text/x-patch, Size: 694 bytes --]

--- linux/drivers/net/hamradio/bpqether.c.bak	2006-02-01 22:13:07.000000000 +0100
+++ linux/drivers/net/hamradio/bpqether.c	2006-02-01 22:30:16.000000000 +0100
@@ -595,6 +595,7 @@
  */
 static int __init bpq_init_driver(void)
 {
+	int ret;
 #ifdef CONFIG_PROC_FS
 	if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) {
 		printk(KERN_ERR
@@ -605,7 +606,12 @@
 
 	dev_add_pack(&bpq_packet_type);
 
-	register_netdevice_notifier(&bpq_dev_notifier);
+	ret = register_netdevice_notifier(&bpq_dev_notifier);
+	if (ret < 0) {
+		printk( KERN_WARNING "register_netdevice_notifier failed in %s\n",__FUNCTION__);
+		dev_remove_pack(&bpq_packet_type);
+		return -1;
+	}
 
 	printk(banner);
 

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2006-02-02 13:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-02 13:35 walter harms [this message]
2006-02-04 17:50 ` [KJ] hamradio/bpqether.c: check return value of Alexey Dobriyan

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=43E20A9A.2070007@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.