summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_dev.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_dev.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_dev.c')
-rw-r--r--sys/dev/dm/dm_dev.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/dm/dm_dev.c b/sys/dev/dm/dm_dev.c
index 727c41c8c1e..24eceb2ab42 100644
--- a/sys/dev/dm/dm_dev.c
+++ b/sys/dev/dm/dm_dev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_dev.c,v 1.9 2014/10/18 08:33:27 snj Exp $ */
+/* $NetBSD: dm_dev.c,v 1.10 2017/06/01 02:45:09 chs Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -319,10 +319,7 @@ dm_dev_alloc(void)
dm_dev_t *dmv;
dmv = kmem_zalloc(sizeof(dm_dev_t), KM_SLEEP);
-
- if (dmv != NULL)
- dmv->diskp = kmem_zalloc(sizeof(struct disk), KM_SLEEP);
-
+ dmv->diskp = kmem_zalloc(sizeof(struct disk), KM_SLEEP);
return dmv;
}
/*