[ROSE]: do proto_unregister() on exit paths

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 c3c4ed65 1f26dac3

+2
+2
net/rose/af_rose.c
··· 1481 1482 if (rose_ndevs > 0x7FFFFFFF/sizeof(struct net_device *)) { 1483 printk(KERN_ERR "ROSE: rose_proto_init - rose_ndevs parameter to large\n"); 1484 return -1; 1485 } 1486 1487 dev_rose = kmalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL); 1488 if (dev_rose == NULL) { 1489 printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); 1490 return -1; 1491 } 1492
··· 1481 1482 if (rose_ndevs > 0x7FFFFFFF/sizeof(struct net_device *)) { 1483 printk(KERN_ERR "ROSE: rose_proto_init - rose_ndevs parameter to large\n"); 1484 + proto_unregister(&rose_proto); 1485 return -1; 1486 } 1487 1488 dev_rose = kmalloc(rose_ndevs * sizeof(struct net_device *), GFP_KERNEL); 1489 if (dev_rose == NULL) { 1490 printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate device structure\n"); 1491 + proto_unregister(&rose_proto); 1492 return -1; 1493 } 1494