From d65a6a674f69502a14737c500056ddadf0269e3c Mon Sep 17 00:00:00 2001 From: chs Date: Thu, 1 Jun 2017 02:45:05 +0000 Subject: 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. --- sys/dev/dm/dm_dev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sys/dev/dm/dm_dev.c') 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; } /* -- cgit