From e7b677aa5de49a6a0619681647c8093900d4cd64 Mon Sep 17 00:00:00 2001 From: Don Brady Date: Thu, 6 Sep 2018 18:36:00 -0600 Subject: [PATCH] Fix zfs_sysfs_live test failure The ZTS zfs_sysfs_live test fails occasionally due to an uninitialized string on an error path. Reviewed-by: Brian Behlendorf Signed-off-by: Don Brady Closes #7869 --- module/zfs/zfs_sysfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/zfs/zfs_sysfs.c b/module/zfs/zfs_sysfs.c index 6bf2e23aae..1eb7f9448c 100644 --- a/module/zfs/zfs_sysfs.c +++ b/module/zfs/zfs_sysfs.c @@ -294,9 +294,11 @@ zprop_sysfs_show(const char *attr_name, const zprop_desc_t *property, property->pd_strdefault : ""; break; case PROP_TYPE_INDEX: - (void) zprop_index_to_string(property->pd_propnum, + if (zprop_index_to_string(property->pd_propnum, property->pd_numdefault, &show_str, - property->pd_types); + property->pd_types) != 0) { + show_str = ""; + } break; default: return (0);