diff options
| author | Don Brady <don.brady@delphix.com> | 2018-09-07 00:36:00 +0000 |
|---|---|---|
| committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2018-09-07 00:36:00 +0000 |
| 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 <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@delphix.com>
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 6bf2e23aaef8..1eb7f9448cb6 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); |
