]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix zfs_sysfs_live test failure
authorDon Brady <don.brady@delphix.com>
Fri, 7 Sep 2018 00:36:00 +0000 (18:36 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 7 Sep 2018 00:36:00 +0000 (17:36 -0700)
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

module/zfs/zfs_sysfs.c

index 6bf2e23aaef871d9ac17f67d2338b395a570f7cd..1eb7f9448cb63645797f883c1743eebdf33975bb 100644 (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);