From: Li Qiang <liq3ea@gmail.com>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] 9pfs: fix crash when fsdev is missing
Date: Tue, 20 Dec 2016 10:01:26 +0800 [thread overview]
Message-ID: <CAKXe6SJG1qGr5UQdqVs06frrQFbyH5-0xeZ9JQEqabwpg+fYrQ@mail.gmail.com> (raw)
In-Reply-To: <148215768690.13973.9042496691140000163.stgit@bahia>
On 2016-12-19 22:28 GMT+08:00 Greg Kurz <groug@kaod.org> wrote:
> 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 702dbcc274e2c.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/9pfs/9p.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index faebd91f5fab..68725b7a1c97 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -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);
>
>
prev parent reply other threads:[~2016-12-20 2:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 14:28 [Qemu-devel] [PATCH] 9pfs: fix crash when fsdev is missing Greg Kurz
2016-12-20 2:01 ` Li Qiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKXe6SJG1qGr5UQdqVs06frrQFbyH5-0xeZ9JQEqabwpg+fYrQ@mail.gmail.com \
--to=liq3ea@gmail.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).