]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
spapr: fix off-by-one error in spapr_ovec_populate_dt()
authorSam Bobroff <sam.bobroff@au1.ibm.com>
Tue, 7 Feb 2017 02:56:44 +0000 (13:56 +1100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 30 Mar 2017 20:45:06 +0000 (15:45 -0500)
The last byte of the option vector was missing due to an off-by-one
error. Without this fix, client architecture support negotiation will
fail because the last byte of option vector 5, which contains the MMU
support, will be missed.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit fe93e3e6ec1b1bf4a4c9d4bf55f8776318da6847)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr_ovec.c

index 3eb1d5976fc072e3461f96c2d67dd152cfb50a65..0bcf311f8b2bdb751e5c7e860aa7d042e5ed2a1a 100644 (file)
@@ -250,5 +250,5 @@ int spapr_ovec_populate_dt(void *fdt, int fdt_offset,
         }
     }
 
-    return fdt_setprop(fdt, fdt_offset, name, vec, vec_len);
+    return fdt_setprop(fdt, fdt_offset, name, vec, vec_len + 1);
 }