mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
9pfs: fix crash when fsdev is missing
If the user passes -device virtio-9p without the corresponding -fsdev, QEMU
dereferences a NULL pointer and crashes.
This is a 2.8 regression introduced by commit 702dbcc274
.
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
This commit is contained in:
parent
88da0b0301
commit
f2b58c4375
1 changed files with 1 additions and 1 deletions
|
@ -3525,7 +3525,7 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp)
|
||||||
rc = 0;
|
rc = 0;
|
||||||
out:
|
out:
|
||||||
if (rc) {
|
if (rc) {
|
||||||
if (s->ops->cleanup && s->ctx.private) {
|
if (s->ops && s->ops->cleanup && s->ctx.private) {
|
||||||
s->ops->cleanup(&s->ctx);
|
s->ops->cleanup(&s->ctx);
|
||||||
}
|
}
|
||||||
g_free(s->tag);
|
g_free(s->tag);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue