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 <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@delphix.com>
Closes #7869
This commit is contained in:
Don Brady 2018-09-06 18:36:00 -06:00 committed by Brian Behlendorf
parent 0238a9755b
commit e7b677aa5d
1 changed files with 4 additions and 2 deletions

View File

@ -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);