diff options
| author | tkusumi <tkusumi@NetBSD.org> | 2019-12-05 16:59:43 +0000 |
|---|---|---|
| committer | tkusumi <tkusumi@NetBSD.org> | 2019-12-05 16:59:43 +0000 |
| commit | 59a98326f58e2471117dd06402e049ce27f36218 (patch) | |
| tree | d36439ecf9fa9f1a5bf78988863c60b0c1c8955c /sys/dev/dm/dm_table.c | |
| parent | 0b4fa5b5b97019300880c93444f6ddb7f097b479 (diff) | |
dm: Make dm core set config to NULL after destroy
Just let dm core do this instead of having a comment expecting each
target to do the right thing.
taken-from: DragonFlyBSD
Diffstat (limited to 'sys/dev/dm/dm_table.c')
| -rw-r--r-- | sys/dev/dm/dm_table.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/dm/dm_table.c b/sys/dev/dm/dm_table.c index 6160ea9134a..54021558725 100644 --- a/sys/dev/dm/dm_table.c +++ b/sys/dev/dm/dm_table.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_table.c,v 1.9 2019/12/04 15:31:12 tkusumi Exp $ */ +/* $NetBSD: dm_table.c,v 1.10 2019/12/05 16:59:43 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.9 2019/12/04 15:31:12 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dm_table.c,v 1.10 2019/12/05 16:59:43 tkusumi Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -162,11 +162,8 @@ dm_table_destroy(dm_table_head_t * head, uint8_t table_id) while (!SLIST_EMPTY(tbl)) { /* List Deletion. */ table_en = SLIST_FIRST(tbl); - /* - * Remove target specific config data. After successfull - * call table_en->target_config must be set to NULL. - */ - table_en->target->destroy(table_en); + if (table_en->target->destroy(table_en) == 0) + table_en->target_config = NULL; SLIST_REMOVE_HEAD(tbl, next); |
