diff options
| author | chs <chs@NetBSD.org> | 2017-06-01 02:45:05 +0000 |
|---|---|---|
| committer | chs <chs@NetBSD.org> | 2017-06-01 02:45:05 +0000 |
| commit | d65a6a674f69502a14737c500056ddadf0269e3c (patch) | |
| tree | d8026148f981c219a25c60a0d75f486ceec0c9ab /sys/dev/dm/dm_pdev.c | |
| parent | fcceec277120326bd7f8a4ec409607c7cc1c52d7 (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_pdev.c')
| -rw-r--r-- | sys/dev/dm/dm_pdev.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/dm/dm_pdev.c b/sys/dev/dm/dm_pdev.c index 81867cebedb..b031c4d83c7 100644 --- a/sys/dev/dm/dm_pdev.c +++ b/sys/dev/dm/dm_pdev.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_pdev.c,v 1.8 2010/12/23 14:58:13 mlelstv Exp $ */ +/* $NetBSD: dm_pdev.c,v 1.9 2017/06/01 02:45:09 chs Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -148,11 +148,8 @@ dm_pdev_alloc(const char *name) { dm_pdev_t *dmp; - if ((dmp = kmem_zalloc(sizeof(dm_pdev_t), KM_SLEEP)) == NULL) - return NULL; - + dmp = kmem_zalloc(sizeof(dm_pdev_t), KM_SLEEP); strlcpy(dmp->name, name, MAX_DEV_NAME); - dmp->ref_cnt = 0; dmp->pdev_vnode = NULL; |
