瀏覽代碼

[ROSE]: do proto_unregister() on exit paths

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan 19 年之前
父節點
當前提交
c3c4ed652e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      net/rose/af_rose.c

+ 2 - 0
net/rose/af_rose.c

@@ -1481,12 +1481,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;
 	}
 
 	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;
 	}