Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9438
b: refs/heads/master
c: 70ff3b6
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Sep 27, 2005
1 parent 896ef1d commit 2af007a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3c4ed652e8f2c348ebdd3f2e45664a0e238ee52
refs/heads/master: 70ff3b66d79c5110e533f3f2aea1a5b2fc5f8d90
10 changes: 6 additions & 4 deletions trunk/net/rose/af_rose.c
Original file line number Diff line number Diff line change
Expand Up @@ -1482,14 +1482,14 @@ static int __init rose_proto_init(void)
if (rose_ndevs > 0x7FFFFFFF/sizeof(struct net_device *)) {
printk(KERN_ERR "ROSE: rose_proto_init - rose_ndevs parameter to large\n");
proto_unregister(&rose_proto);
return -1;
return -EINVAL;
}

dev_rose = kmalloc(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");
proto_unregister(&rose_proto);
return -1;
return -ENOMEM;
}

memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*));
Expand All @@ -1502,9 +1502,11 @@ static int __init rose_proto_init(void)
name, rose_setup);
if (!dev) {
printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n");
rc = -ENOMEM;
goto fail;
}
if (register_netdev(dev)) {
rc = register_netdev(dev);
if (rc) {
printk(KERN_ERR "ROSE: netdevice regeistration failed\n");
free_netdev(dev);
goto fail;
Expand Down Expand Up @@ -1539,7 +1541,7 @@ static int __init rose_proto_init(void)
}
kfree(dev_rose);
proto_unregister(&rose_proto);
return -ENOMEM;
goto out;
}
module_init(rose_proto_init);

Expand Down

0 comments on commit 2af007a

Please sign in to comment.