All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scc fix for 2.6.0
@ 2003-12-25 18:52 Jeroen Vreeken
  2003-12-26 10:28 ` Re : " Jean-Luc Coulon (f5ibh)
  2003-12-27  4:05 ` Ralf Baechle DO1GRB
  0 siblings, 2 replies; 4+ messages in thread
From: Jeroen Vreeken @ 2003-12-25 18:52 UTC (permalink / raw)
  To: linux-hams; +Cc: jgarzik, ralf

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

Hi,

This is a fix for the scc driver in 2.6.0
It was calling register_netdev from within a ioctl and thus holding
rtnl_lock()
It now uses register_netdevice and calls rtnl_lock() itself if outside the
ioctl.

Jeroen

[-- Attachment #2: scc-linux-2.6.0.rxq.diff --]
[-- Type: application/octet-stream, Size: 918 bytes --]

--- linux-2.6.0/drivers/net/hamradio/scc.c	2003-12-18 03:59:27.000000000 +0100
+++ linux-2.6.0.rxq/drivers/net/hamradio/scc.c	2003-12-25 17:57:58.000000000 +0100
@@ -163,6 +163,7 @@
 #include <linux/delay.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
 #include <linux/if_ether.h>
 #include <linux/if_arp.h>
 #include <linux/socket.h>
@@ -1526,7 +1527,7 @@
 	scc->dev = dev;
 	spin_lock_init(&scc->lock);
 
-	err = register_netdev(dev);
+	err = register_netdevice(dev);
 	if (err) {
 		printk(KERN_ERR "%s: can't register network device (%d)\n", 
 		       name, err);
@@ -2119,10 +2120,13 @@
 	
 	sprintf(devname,"%s0", SCC_DriverName);
 	
+	rtnl_lock();
 	if (scc_net_alloc(devname, SCC_Info)) {
+		rtnl_unlock();
 		printk(KERN_ERR "z8530drv: cannot initialize module\n");
 		return -EIO;
 	}
+	rtnl_unlock();
 
 	proc_net_fops_create("z8530drv", 0, &scc_net_seq_fops);
 

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

end of thread, other threads:[~2003-12-30 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-25 18:52 [PATCH] scc fix for 2.6.0 Jeroen Vreeken
2003-12-26 10:28 ` Re : " Jean-Luc Coulon (f5ibh)
2003-12-27  4:05 ` Ralf Baechle DO1GRB
2003-12-30 18:41   ` Jeroen Vreeken

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.