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_target_linear.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_target_linear.c')
| -rw-r--r-- | sys/dev/dm/dm_target_linear.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/dm/dm_target_linear.c b/sys/dev/dm/dm_target_linear.c index 098445be784..b8397423bf7 100644 --- a/sys/dev/dm/dm_target_linear.c +++ b/sys/dev/dm/dm_target_linear.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_target_linear.c,v 1.14 2014/06/14 07:39:00 hannken Exp $ */ +/* $NetBSD: dm_target_linear.c,v 1.15 2017/06/01 02:45:09 chs Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -82,10 +82,7 @@ dm_target_linear_init(dm_dev_t * dmv, void **target_config, char *params) if ((dmp = dm_pdev_insert(argv[0])) == NULL) return ENOENT; - if ((tlc = kmem_alloc(sizeof(dm_target_linear_config_t), KM_SLEEP)) - == NULL) - return ENOMEM; - + tlc = kmem_alloc(sizeof(dm_target_linear_config_t), KM_SLEEP); tlc->pdev = dmp; tlc->offset = 0; /* default settings */ |
