DORMANTno replies

[PATCH 1/3] rose: do proto_unregister() on exit paths

From: Alexey Dobriyan <hidden>
Date: 2005-09-27 22:20:18
Also in: linux-hams

Signed-off-by: Alexey Dobriyan <redacted>
---

 net/rose/af_rose.c |    2 ++
 1 file changed, 2 insertions(+)
--- linux-rose-000/net/rose/af_rose.c
+++ linux-rose-001/net/rose/af_rose.c
@@ -1475,24 +1475,26 @@ static int __init rose_proto_init(void)
 	int rc = proto_register(&rose_proto, 0);
 
 	if (rc != 0)
 		goto out;
 
 	rose_callsign = null_ax25_address;
 
 	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;
 	}
 
 	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;
 	}
 
 	memset(dev_rose, 0x00, rose_ndevs * sizeof(struct net_device*));
 	for (i = 0; i < rose_ndevs; i++) {
 		struct net_device *dev;
 		char name[IFNAMSIZ];
 
 		sprintf(name, "rose%d", i);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help