summaryrefslogtreecommitdiff
path: root/usr/src/lib/libscf/common/midlevel.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libscf/common/midlevel.c')
-rw-r--r--usr/src/lib/libscf/common/midlevel.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr/src/lib/libscf/common/midlevel.c b/usr/src/lib/libscf/common/midlevel.c
index 3037e85113..69d5bd09d3 100644
--- a/usr/src/lib/libscf/common/midlevel.c
+++ b/usr/src/lib/libscf/common/midlevel.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2018 RackTop Systems.
*/
#include "libscf_impl.h"
@@ -2601,6 +2602,13 @@ scf_read_propvec(const char *fmri, const char *pgname, boolean_t running,
scf_propvec_t *prop;
int error = 0;
+ for (prop = properties; prop->pv_prop != NULL; prop++) {
+ if (prop->pv_type == SCF_TYPE_OPAQUE)
+ ((scf_opaque_t *)prop->pv_ptr)->so_addr = NULL;
+ else if (scf_true_base_type(prop->pv_type) == SCF_TYPE_ASTRING)
+ *((char **)prop->pv_ptr) = NULL;
+ }
+
if (h == NULL || s == NULL || i == NULL || (running && snap == NULL) ||
pg == NULL || p == NULL || v == NULL)
goto scferror;
@@ -2630,13 +2638,6 @@ scf_read_propvec(const char *fmri, const char *pgname, boolean_t running,
goto scferror;
for (prop = properties; prop->pv_prop != NULL; prop++) {
- if (prop->pv_type == SCF_TYPE_OPAQUE)
- ((scf_opaque_t *)prop->pv_ptr)->so_addr = NULL;
- else if (scf_true_base_type(prop->pv_type) == SCF_TYPE_ASTRING)
- *((char **)prop->pv_ptr) = NULL;
- }
-
- for (prop = properties; prop->pv_prop != NULL; prop++) {
int ret = 0;
if (scf_pg_get_property(pg, prop->pv_prop, p) == -1 ||