diff options
author | Don Brady <[email protected]> | 2018-09-06 18:36:00 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-09-06 17:36:00 -0700 |
commit | e7b677aa5de49a6a0619681647c8093900d4cd64 (patch) | |
tree | 174fdf5ae267737b666124a2128a9252787bccba | |
parent | 0238a9755b07d1a2705e970f5c09fb7fa261ea5d (diff) |
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 <[email protected]>
Signed-off-by: Don Brady <[email protected]>
Closes #7869
-rw-r--r-- | module/zfs/zfs_sysfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/zfs/zfs_sysfs.c b/module/zfs/zfs_sysfs.c index 6bf2e23aa..1eb7f9448 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); |