netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH] cosa -- incorrect comparison for register_netdev
Date: Thu, 9 Oct 2003 11:27:14 -0700	[thread overview]
Message-ID: <20031009112714.18742308.shemminger@osdl.org> (raw)

If register_netdev fails this driver will be in trouble because
the return values are things like -EIO or -EEXIST, not just -1.

diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
--- a/drivers/net/wan/cosa.c	Thu Oct  9 11:24:39 2003
+++ b/drivers/net/wan/cosa.c	Thu Oct  9 11:24:39 2003
@@ -615,7 +615,7 @@
 	d->get_stats = cosa_net_stats;
 	d->tx_timeout = cosa_sppp_timeout;
 	d->watchdog_timeo = TX_TIMEOUT;
-	if (register_netdev(d) == -1) {
+	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(chan->pppdev.dev);
 		free_netdev(chan->pppdev.dev);

             reply	other threads:[~2003-10-09 18:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-09 18:27 Stephen Hemminger [this message]
2003-10-10  7:01 ` [PATCH] cosa -- incorrect comparison for register_netdev David S. Miller
2003-10-10 17:32   ` [PATCH] synclink -- incorrect check of register_netdev return val Stephen Hemminger
2003-10-11 19:13     ` David S. Miller
2003-10-10 17:32   ` [PATCH] hostess -- return value check for register_netdev Stephen Hemminger
2003-10-11 19:12     ` David S. Miller

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=20031009112714.18742308.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).