summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_ioctl.c
diff options
context:
space:
mode:
authorhaad <haad@NetBSD.org>2009-02-20 11:12:30 +0000
committerhaad <haad@NetBSD.org>2009-02-20 11:12:30 +0000
commit9629be83bfb46f6cd1b3accb5401b35940b41079 (patch)
tree15fcd0e528c6857928246232da84b8f504f0b021 /sys/dev/dm/dm_ioctl.c
parent3d7b4bf38019d99aa0554f395db5773bbd281f94 (diff)
Release tables before we drop reference on device, now creating device with
nonexistent target fails and not ends with deadlock.
Diffstat (limited to 'sys/dev/dm/dm_ioctl.c')
-rw-r--r--sys/dev/dm/dm_ioctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/dm/dm_ioctl.c b/sys/dev/dm/dm_ioctl.c
index 3b73c68293e..9d569265106 100644
--- a/sys/dev/dm/dm_ioctl.c
+++ b/sys/dev/dm/dm_ioctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.7 2009/02/19 23:07:33 haad Exp $ */
+/* $NetBSD: dm_ioctl.c,v 1.8 2009/02/20 11:12:30 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -746,12 +746,14 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
*/
if (((target = dm_target_lookup(type)) == NULL) &&
((target = dm_target_autoload(type)) == NULL)) {
+ dm_table_release(&dmv->table_head, DM_TABLE_INACTIVE);
dm_dev_unbusy(dmv);
return ENOENT;
}
if ((table_en = kmem_alloc(sizeof(dm_table_entry_t),
KM_NOSLEEP)) == NULL) {
+ dm_table_release(&dmv->table_head, DM_TABLE_INACTIVE);
dm_dev_unbusy(dmv);
return ENOMEM;
}