Commit f05ed067 authored by Joe Thornber's avatar Joe Thornber Committed by Linus Torvalds

[PATCH] dm: deregister the misc device before removing /dev/mapper

Fix problem with devfs when unloading the dm module.

dm-ioctl.c: deregister the misc device, and its associated symlink
*before* removing the /dev/mapper dir.  [Alasdair Kergon]
parent 61a295e8
...@@ -1127,17 +1127,17 @@ int __init dm_interface_init(void) ...@@ -1127,17 +1127,17 @@ int __init dm_interface_init(void)
return 0; return 0;
failed: failed:
devfs_remove(DM_DIR "/control");
if (misc_deregister(&_dm_misc) < 0)
DMERR("misc_deregister failed for control device");
dm_hash_exit(); dm_hash_exit();
misc_deregister(&_dm_misc);
return r; return r;
} }
void dm_interface_exit(void) void dm_interface_exit(void)
{ {
dm_hash_exit();
devfs_remove(DM_DIR "/control"); devfs_remove(DM_DIR "/control");
if (misc_deregister(&_dm_misc) < 0) if (misc_deregister(&_dm_misc) < 0)
DMERR("misc_deregister failed for control device"); DMERR("misc_deregister failed for control device");
dm_hash_exit();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment