From 9629be83bfb46f6cd1b3accb5401b35940b41079 Mon Sep 17 00:00:00 2001 From: haad Date: Fri, 20 Feb 2009 11:12:30 +0000 Subject: [PATCH] Release tables before we drop reference on device, now creating device with nonexistent target fails and not ends with deadlock. --- sys/dev/dm/dm_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/dm/dm_ioctl.c b/sys/dev/dm/dm_ioctl.c index 3b73c68293ef..9d569265106f 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; }