summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_ioctl.c
diff options
context:
space:
mode:
authorchs <chs@NetBSD.org>2017-06-01 02:45:05 +0000
committerchs <chs@NetBSD.org>2017-06-01 02:45:05 +0000
commitd65a6a674f69502a14737c500056ddadf0269e3c (patch)
treed8026148f981c219a25c60a0d75f486ceec0c9ab /sys/dev/dm/dm_ioctl.c
parentfcceec277120326bd7f8a4ec409607c7cc1c52d7 (diff)
remove checks for failure after memory allocation calls that cannot fail:
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create() all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
Diffstat (limited to 'sys/dev/dm/dm_ioctl.c')
-rw-r--r--sys/dev/dm/dm_ioctl.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/dm/dm_ioctl.c b/sys/dev/dm/dm_ioctl.c
index 8f66da08ed1..04040b2f9a2 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.30 2015/05/10 14:08:54 christos Exp $ */
+/* $NetBSD: dm_ioctl.c,v 1.31 2017/06/01 02:45:09 chs Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -748,13 +748,7 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
prop_object_iterator_release(iter);
return ENOENT;
}
- if ((table_en = kmem_alloc(sizeof(dm_table_entry_t),
- KM_SLEEP)) == NULL) {
- dm_table_release(&dmv->table_head, DM_TABLE_INACTIVE);
- dm_dev_unbusy(dmv);
- prop_object_iterator_release(iter);
- return ENOMEM;
- }
+ table_en = kmem_alloc(sizeof(dm_table_entry_t), KM_SLEEP);
prop_dictionary_get_uint64(target_dict, DM_TABLE_START,
&table_en->start);
prop_dictionary_get_uint64(target_dict, DM_TABLE_LENGTH,