summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/libcfgadm/common/config_admin.c17
-rw-r--r--usr/src/lib/libdevinfo/devinfo.c2
2 files changed, 10 insertions, 9 deletions
diff --git a/usr/src/lib/libcfgadm/common/config_admin.c b/usr/src/lib/libcfgadm/common/config_admin.c
index d642fa820b..767332c631 100644
--- a/usr/src/lib/libcfgadm/common/config_admin.c
+++ b/usr/src/lib/libcfgadm/common/config_admin.c
@@ -2570,26 +2570,27 @@ config_err(int errnum, int err_type, char **errstring)
* do_list_common - list non-SHP attachment point
*/
static int
-do_list_common(
- di_node_t node,
- di_minor_t minor,
- void *arg)
+do_list_common(di_node_t node, di_minor_t minor, void *arg)
{
di_node_t rnode;
di_hp_t hp;
char *minor_name;
+ char *phys_path;
- minor_name = di_minor_name(minor);
+ if ((minor_name = di_minor_name(minor)) == NULL)
+ return (DI_WALK_CONTINUE);
/*
* since PCIE/PCIHSHPC connectors have both hp nodes and minor nodes
* created for now, we need to specifically exclude these connectors
* during walking minor nodes.
*/
- if ((rnode = di_init(di_devfs_path(node), DINFOSUBTREE | DINFOHP))
- == DI_NODE_NIL) {
+ if ((phys_path = di_devfs_path(node)) == NULL)
+ return (DI_WALK_CONTINUE);
+ rnode = di_init(phys_path, DINFOSUBTREE | DINFOHP);
+ di_devfs_path_free(phys_path);
+ if (rnode == DI_NODE_NIL)
return (DI_WALK_CONTINUE);
- }
for (hp = DI_HP_NIL; (hp = di_hp_next(rnode, hp)) != DI_HP_NIL; ) {
if (strcmp(di_hp_name(hp), minor_name) == 0) {
diff --git a/usr/src/lib/libdevinfo/devinfo.c b/usr/src/lib/libdevinfo/devinfo.c
index 68e51960a2..678f891c90 100644
--- a/usr/src/lib/libdevinfo/devinfo.c
+++ b/usr/src/lib/libdevinfo/devinfo.c
@@ -1065,7 +1065,7 @@ di_driver_ops(di_node_t node)
}
/*
- * returns the length of the path, caller must free memory
+ * Returns pointer to the allocated string, which must be freed by the caller.
*/
char *
di_devfs_path(di_node_t node)