diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2015-01-10 19:50:21 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2015-01-10 19:50:21 +0000 |
| commit | 97052d64e4fb934bcf25f4a6b42dc06f6ecbf9eb (patch) | |
| tree | c4a72adc118c1cc1ca6e0c51c4072158ce3d1bc1 /device_tree.c | |
| parent | e77d927f1a1876ef341b4df287939b0c935703d5 (diff) | |
| parent | 75c74ccbe1d4175edb79c6f810c2207dcf5edb22 (diff) | |
| download | focaccia-qemu-97052d64e4fb934bcf25f4a6b42dc06f6ecbf9eb.tar.gz focaccia-qemu-97052d64e4fb934bcf25f4a6b42dc06f6ecbf9eb.zip | |
Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' into staging
Patch queue for ppc - 2015-01-07 New year's release. This time's highlights: - E500: More RAM support - pseries: New SLOF release - Migration fixes - Simplify USB spawning logic, removes support for explicit usb=off - TCG: Simple untansactional TM emulation # gpg: Signature made Wed 07 Jan 2015 15:19:37 GMT using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-ppc-for-upstream: (37 commits) hw/ppc/mac_newworld: simplify usb controller creation logic hw/ppc/spapr: simplify usb controller creation logic hw/ppc/mac_newworld: QOMified mac99 machines hw/usb: simplified usb_enabled hw/machine: added machine_usb wrapper hw/ppc: modified the condition for usb controllers to be created for some ppc machines target-ppc: Cast ssize_t to size_t before printing with %zx target-ppc: Mark SR() and gen_sync_exception() as !CONFIG_USER_ONLY PPC: e500: Fix GPIO controller interrupt number target-ppc: Introduce Privileged TM Noops target-ppc: Introduce tcheck target-ppc: Introduce TM Noops target-ppc: Introduce tbegin target-ppc: Introduce TEXASRU Bit Fields target-ppc: Power8 Supports Transactional Memory target-ppc: Introduce tm_enabled Bit to CPU State target-ppc: Introduce Feature Flag for Transactional Memory target-ppc: Introduce Instruction Type for Transactional Memory pseries: Update SLOF firmware image to 20141202 PPC: Fix crash on spapr_tce_table_finalize() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'device_tree.c')
| -rw-r--r-- | device_tree.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/device_tree.c b/device_tree.c index df9eed9cbc..4cb1cd50aa 100644 --- a/device_tree.c +++ b/device_tree.c @@ -324,6 +324,7 @@ int qemu_fdt_setprop_sized_cells_from_array(void *fdt, uint64_t value; int cellnum, vnum, ncells; uint32_t hival; + int ret; propcells = g_new0(uint32_t, numvalues * 2); @@ -331,18 +332,23 @@ int qemu_fdt_setprop_sized_cells_from_array(void *fdt, for (vnum = 0; vnum < numvalues; vnum++) { ncells = values[vnum * 2]; if (ncells != 1 && ncells != 2) { - return -1; + ret = -1; + goto out; } value = values[vnum * 2 + 1]; hival = cpu_to_be32(value >> 32); if (ncells > 1) { propcells[cellnum++] = hival; } else if (hival != 0) { - return -1; + ret = -1; + goto out; } propcells[cellnum++] = cpu_to_be32(value); } - return qemu_fdt_setprop(fdt, node_path, property, propcells, - cellnum * sizeof(uint32_t)); + ret = qemu_fdt_setprop(fdt, node_path, property, propcells, + cellnum * sizeof(uint32_t)); +out: + g_free(propcells); + return ret; } |