aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 41c9549b32a..bb5c1eaca52 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -7,6 +7,7 @@
7 7
8#include "dm.h" 8#include "dm.h"
9#include "dm-bio-list.h" 9#include "dm-bio-list.h"
10#include "dm-uevent.h"
10 11
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/module.h> 13#include <linux/module.h>
@@ -143,11 +144,19 @@ static int __init local_init(void)
143 return -ENOMEM; 144 return -ENOMEM;
144 } 145 }
145 146
147 r = dm_uevent_init();
148 if (r) {
149 kmem_cache_destroy(_tio_cache);
150 kmem_cache_destroy(_io_cache);
151 return r;
152 }
153
146 _major = major; 154 _major = major;
147 r = register_blkdev(_major, _name); 155 r = register_blkdev(_major, _name);
148 if (r < 0) { 156 if (r < 0) {
149 kmem_cache_destroy(_tio_cache); 157 kmem_cache_destroy(_tio_cache);
150 kmem_cache_destroy(_io_cache); 158 kmem_cache_destroy(_io_cache);
159 dm_uevent_exit();
151 return r; 160 return r;
152 } 161 }
153 162
@@ -162,6 +171,7 @@ static void local_exit(void)
162 kmem_cache_destroy(_tio_cache); 171 kmem_cache_destroy(_tio_cache);
163 kmem_cache_destroy(_io_cache); 172 kmem_cache_destroy(_io_cache);
164 unregister_blkdev(_major, _name); 173 unregister_blkdev(_major, _name);
174 dm_uevent_exit();
165 175
166 _major = 0; 176 _major = 0;
167 177