[ROSE]: return sane -E* from rose_proto_init()

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Alexey Dobriyan and committed by David S. Miller 70ff3b66 c3c4ed65

+6 -4
+6 -4
net/rose/af_rose.c
··· 1482 1482 if (rose_ndevs > 0x7FFFFFFF/sizeof(struct net_device *)) { 1483 1483 printk(KERN_ERR "ROSE: rose_proto_init - rose_ndevs parameter to large\n"); 1484 1484 proto_unregister(&rose_proto); 1485 - return -1; 1485 + return -EINVAL; 1486 1486 } 1487 1487 1488 1488 dev_rose = kmalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL); 1489 1489 if (dev_rose == NULL) { 1490 1490 printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); 1491 1491 proto_unregister(&rose_proto); 1492 - return -1; 1492 + return -ENOMEM; 1493 1493 } 1494 1494 1495 1495 memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*)); ··· 1502 1502 name, rose_setup); 1503 1503 if (!dev) { 1504 1504 printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n"); 1505 + rc = -ENOMEM; 1505 1506 goto fail; 1506 1507 } 1507 - if (register_netdev(dev)) { 1508 + rc = register_netdev(dev); 1509 + if (rc) { 1508 1510 printk(KERN_ERR "ROSE: netdevice regeistration failed\n"); 1509 1511 free_netdev(dev); 1510 1512 goto fail; ··· 1541 1539 } 1542 1540 kfree(dev_rose); 1543 1541 proto_unregister(&rose_proto); 1544 - return -ENOMEM; 1542 + goto out; 1545 1543 } 1546 1544 module_init(rose_proto_init); 1547 1545