diff options
author | John W. Linville <linville@tuxdriver.com> | 2006-07-27 14:27:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-07-27 14:27:06 -0400 |
commit | 20f99dcf417a28089ef6c877ae97f5dec2eab435 (patch) | |
tree | b4fe1f3e429d6a82ddaaa8e12899da630cfa8a63 /net/rose/af_rose.c | |
parent | dd2f5538a157bda68bfa8efb39feaaccdda9e74e (diff) | |
parent | 64821324ca49f24be1a66f2f432108f96a24e596 (diff) |
Merge branch 'from-linus' into upstream
Diffstat (limited to 'net/rose/af_rose.c')
-rw-r--r-- | net/rose/af_rose.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index d0a67bb3136..08a54285565 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -67,6 +67,14 @@ static struct proto_ops rose_proto_ops; ax25_address rose_callsign; /* + * ROSE network devices are virtual network devices encapsulating ROSE + * frames into AX.25 which will be sent through an AX.25 device, so form a + * special "super class" of normal net devices; split their locks off into a + * separate class since they always nest. + */ +static struct lock_class_key rose_netdev_xmit_lock_key; + +/* * Convert a ROSE address into text. */ const char *rose2asc(const rose_address *addr) @@ -1490,14 +1498,13 @@ static int __init rose_proto_init(void) rose_callsign = null_ax25_address; - dev_rose = kmalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL); + dev_rose = kzalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL); if (dev_rose == NULL) { printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); rc = -ENOMEM; goto out_proto_unregister; } - memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*)); for (i = 0; i < rose_ndevs; i++) { struct net_device *dev; char name[IFNAMSIZ]; @@ -1516,6 +1523,7 @@ static int __init rose_proto_init(void) free_netdev(dev); goto fail; } + lockdep_set_class(&dev->_xmit_lock, &rose_netdev_xmit_lock_key); dev_rose[i] = dev; } |