On Mon, Feb 28, 2022 at 02:49:51PM -0300, Daniel Henrique Barboza wrote:
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/ppc/spapr.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index f0b75b22bb..c74543ace3 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1018,9 +1018,9 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)
>
> if (reset) {
> const char *boot_device = spapr->boot_device;
> - char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus);
> + g_autofree char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus);
> size_t cb = 0;
> - char *bootlist = get_boot_devices_list(&cb);
> + g_autofree char *bootlist = get_boot_devices_list(&cb);
>
> if (machine->kernel_cmdline && machine->kernel_cmdline[0]) {
> _FDT(fdt_setprop_string(fdt, chosen, "bootargs",
> @@ -1087,9 +1087,6 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)
> }
>
> spapr_dt_ov5_platform_support(spapr, fdt, chosen);
> -
> - g_free(stdout_path);
> - g_free(bootlist);
> }
>
> _FDT(spapr_dt_ovec(fdt, chosen, spapr->ov5_cas, "ibm,architecture-vec-5"));
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson