[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 02/62] power: Fix uninitialised variable warning



In
  power: Record approach used for power cycles in runvars
we introduced a reference to $r{$rv} which might be undef,
resulting in this:
  Use of uninitialized value in concatenation (.) or string at 
Osstest/TestSupport.pm line 1069.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 334cc2cb..d35a784b 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1023,7 +1023,7 @@ sub power_reboot_attempts ($$$;$$) {
            logm("power: rebooted $ho->{Name} (using $approach->{Name})");
            if (defined $record_runvar_tail) {
                my $rv = "$ho->{Ident}_power_${record_runvar_tail}";
-               my $newval = $r{$rv}.(!!length($r{$rv}) and ',')
+               my $newval = ($r{$rv} // '').(!!length($r{$rv}) and ',')
                    .$approach->{Name};
                store_runvar($rv, $newval);
            }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.