mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-03 05:00:31 -07:00
9pfs: adjust the order of resource cleanup in device unrealize
Unrealize should undo things that were set during realize in reverse order. So should do in the error path in realize. Signed-off-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Greg Kurz <groug@kaod.org>
This commit is contained in:
parent
00227fefd2
commit
4774718e5c
1 changed files with 2 additions and 2 deletions
|
|
@ -3521,8 +3521,8 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp)
|
|||
rc = 0;
|
||||
out:
|
||||
if (rc) {
|
||||
g_free(s->ctx.fs_root);
|
||||
g_free(s->tag);
|
||||
g_free(s->ctx.fs_root);
|
||||
v9fs_path_free(&path);
|
||||
}
|
||||
return rc;
|
||||
|
|
@ -3530,8 +3530,8 @@ out:
|
|||
|
||||
void v9fs_device_unrealize_common(V9fsState *s, Error **errp)
|
||||
{
|
||||
g_free(s->ctx.fs_root);
|
||||
g_free(s->tag);
|
||||
g_free(s->ctx.fs_root);
|
||||
}
|
||||
|
||||
typedef struct VirtfsCoResetData {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue