Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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);
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);
}
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);
}
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);
}
memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*));
}
memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*));
name, rose_setup);
if (!dev) {
printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n");
name, rose_setup);
if (!dev) {
printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n");
- if (register_netdev(dev)) {
+ rc = register_netdev(dev);
+ if (rc) {
printk(KERN_ERR "ROSE: netdevice regeistration failed\n");
free_netdev(dev);
goto fail;
printk(KERN_ERR "ROSE: netdevice regeistration failed\n");
free_netdev(dev);
goto fail;
}
kfree(dev_rose);
proto_unregister(&rose_proto);
}
kfree(dev_rose);
proto_unregister(&rose_proto);
}
module_init(rose_proto_init);
}
module_init(rose_proto_init);