From 3cfbeb4e906df75ac3377c0bf952f16c37ea93a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Wed, 16 Mar 2022 19:56:46 +0100 Subject: [PATCH] zfs: main: don't NULL-check infallible safe_malloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia ZiemiaƄska Closes #13229 --- cmd/zfs/zfs_main.c | 2 -- cmd/zfs/zfs_util.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index b153d217df..ae8e5043da 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -5473,8 +5473,6 @@ parse_fs_perm_set(fs_perm_set_t *fspset, nvlist_t *nvl) data_type_t type = nvpair_type(nvp); fs_perm_t *fsperm = NULL; fs_perm_node_t *node = safe_malloc(sizeof (fs_perm_node_t)); - if (node == NULL) - nomem(); fsperm = &node->fspn_fsperm; diff --git a/cmd/zfs/zfs_util.h b/cmd/zfs/zfs_util.h index a56af59adb..cd0dc3ed04 100644 --- a/cmd/zfs/zfs_util.h +++ b/cmd/zfs/zfs_util.h @@ -31,7 +31,7 @@ extern "C" { #endif -void * safe_malloc(size_t size); +void *safe_malloc(size_t size); void nomem(void); extern libzfs_handle_t *g_zfs;