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 commitstable-2.8702dbcc274
. Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Li Qiang <liq3ea@gmail.com> (cherry picked from commitf2b58c4375
) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
parent
7830be742a
commit
da95bfe06b
|
@ -3521,7 +3521,7 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp)
|
|||
rc = 0;
|
||||
out:
|
||||
if (rc) {
|
||||
if (s->ops->cleanup && s->ctx.private) {
|
||||
if (s->ops && s->ops->cleanup && s->ctx.private) {
|
||||
s->ops->cleanup(&s->ctx);
|
||||
}
|
||||
g_free(s->tag);
|
||||
|
|
Loading…
Reference in New Issue