All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cosa -- incorrect comparison for register_netdev
@ 2003-10-09 18:27 Stephen Hemminger
  2003-10-10  7:01 ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2003-10-09 18:27 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-10-11 19:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-09 18:27 [PATCH] cosa -- incorrect comparison for register_netdev Stephen Hemminger
2003-10-10  7:01 ` 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

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.