You need to sign in or sign up before continuing.
提交 da95bfe0 编写于 作者: G Greg Kurz 提交者: Michael Roth

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 702dbcc2.
Signed-off-by: NGreg Kurz <groug@kaod.org>
Reviewed-by: NLi Qiang <liq3ea@gmail.com>
(cherry picked from commit f2b58c43)
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 7830be74
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册