mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-25 23:15:49 +00:00
hw/ppc/spapr_drc.c: use g_autofree in drc_realize()
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220228175004.8862-8-danielhb413@gmail.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
parent
75610acfd3
commit
37deca77a6
@ -519,8 +519,8 @@ static const VMStateDescription vmstate_spapr_drc = {
|
||||
static void drc_realize(DeviceState *d, Error **errp)
|
||||
{
|
||||
SpaprDrc *drc = SPAPR_DR_CONNECTOR(d);
|
||||
g_autofree gchar *link_name = g_strdup_printf("%x", spapr_drc_index(drc));
|
||||
Object *root_container;
|
||||
gchar *link_name;
|
||||
const char *child_name;
|
||||
|
||||
trace_spapr_drc_realize(spapr_drc_index(drc));
|
||||
@ -532,12 +532,10 @@ static void drc_realize(DeviceState *d, Error **errp)
|
||||
* existing in the composition tree
|
||||
*/
|
||||
root_container = container_get(object_get_root(), DRC_CONTAINER_PATH);
|
||||
link_name = g_strdup_printf("%x", spapr_drc_index(drc));
|
||||
child_name = object_get_canonical_path_component(OBJECT(drc));
|
||||
trace_spapr_drc_realize_child(spapr_drc_index(drc), child_name);
|
||||
object_property_add_alias(root_container, link_name,
|
||||
drc->owner, child_name);
|
||||
g_free(link_name);
|
||||
vmstate_register(VMSTATE_IF(drc), spapr_drc_index(drc), &vmstate_spapr_drc,
|
||||
drc);
|
||||
trace_spapr_drc_realize_complete(spapr_drc_index(drc));
|
||||
|
Loading…
x
Reference in New Issue
Block a user