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

* Re: [PATCH] cosa -- incorrect comparison for register_netdev
  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-10 17:32   ` [PATCH] hostess -- return value check for register_netdev Stephen Hemminger
  0 siblings, 2 replies; 6+ messages in thread
From: David S. Miller @ 2003-10-10  7:01 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: jgarzik, netdev

On Thu, 9 Oct 2003 11:27:14 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

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

Applied, thanks Stephen.

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

* [PATCH] synclink -- incorrect check of register_netdev return val.
  2003-10-10  7:01 ` David S. Miller
@ 2003-10-10 17:32   ` 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
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2003-10-10 17:32 UTC (permalink / raw)
  To: David S. Miller; +Cc: jgarzik, netdev

The synclink family of drivers all check for register_netdev returning
-1 when in fact it will return -EIO or -EEXIST.

diff -Nru a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
--- a/drivers/char/pcmcia/synclink_cs.c	Fri Oct 10 10:00:46 2003
+++ b/drivers/char/pcmcia/synclink_cs.c	Fri Oct 10 10:00:46 2003
@@ -4232,7 +4232,7 @@
 	d->tx_timeout = mgslpc_sppp_tx_timeout;
 	d->watchdog_timeo = 10*HZ;
 
-	if (register_netdev(d) == -1) {
+	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(info->netdev);
 		return;
diff -Nru a/drivers/char/synclink.c b/drivers/char/synclink.c
--- a/drivers/char/synclink.c	Fri Oct 10 10:00:46 2003
+++ b/drivers/char/synclink.c	Fri Oct 10 10:00:46 2003
@@ -7847,7 +7847,7 @@
 	d->tx_timeout = mgsl_sppp_tx_timeout;
 	d->watchdog_timeo = 10*HZ;
 
-	if (register_netdev(d) == -1) {
+	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(info->netdev);
 		return;
diff -Nru a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
--- a/drivers/char/synclinkmp.c	Fri Oct 10 10:00:46 2003
+++ b/drivers/char/synclinkmp.c	Fri Oct 10 10:00:46 2003
@@ -1653,7 +1653,7 @@
 	d->tx_timeout = sppp_cb_tx_timeout;
 	d->watchdog_timeo = 10*HZ;
 
-	if (register_netdev(d) == -1) {
+	if (register_netdev(d)) {
 		printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
 		sppp_detach(info->netdev);
 		return;

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

* [PATCH] hostess -- return value check for register_netdev
  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-10 17:32   ` Stephen Hemminger
  2003-10-11 19:12     ` David S. Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2003-10-10 17:32 UTC (permalink / raw)
  To: David S. Miller; +Cc: jgarzik, netdev

Another driver that checks for register_netdev returing -1 when
it can return -EIO or -EEXIST.

diff -Nru a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
--- a/drivers/net/wan/hostess_sv11.c	Fri Oct 10 09:58:31 2003
+++ b/drivers/net/wan/hostess_sv11.c	Fri Oct 10 09:58:31 2003
@@ -337,7 +337,7 @@
 		d->neigh_setup = hostess_neigh_setup_dev;
 		d->set_mac_address = NULL;
 		
-		if(register_netdev(d)==-1)
+		if(register_netdev(d))
 		{
 			printk(KERN_ERR "%s: unable to register device.\n",
 				d->name);

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

* Re: [PATCH] hostess -- return value check for register_netdev
  2003-10-10 17:32   ` [PATCH] hostess -- return value check for register_netdev Stephen Hemminger
@ 2003-10-11 19:12     ` David S. Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David S. Miller @ 2003-10-11 19:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: jgarzik, netdev

On Fri, 10 Oct 2003 10:32:25 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> Another driver that checks for register_netdev returing -1 when
> it can return -EIO or -EEXIST.

Applied, thanks Stephen.

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

* Re: [PATCH] synclink -- incorrect check of register_netdev return val.
  2003-10-10 17:32   ` [PATCH] synclink -- incorrect check of register_netdev return val Stephen Hemminger
@ 2003-10-11 19:13     ` David S. Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David S. Miller @ 2003-10-11 19:13 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: jgarzik, netdev

On Fri, 10 Oct 2003 10:32:02 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> The synclink family of drivers all check for register_netdev returning
> -1 when in fact it will return -EIO or -EEXIST.

Also applied, thanks.

^ 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.