[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/13] 9pfs: fix crash when fsdev is missing
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PULL 05/13] 9pfs: fix crash when fsdev is missing |
Date: |
Wed, 4 Jan 2017 09:21:39 +0100 |
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 <address@hidden>
Reviewed-by: Li Qiang <address@hidden>
---
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 97c2926aae50..fa58877570f6 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3525,7 +3525,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);
--
2.7.4
- [Qemu-devel] [PULL 00/13] 9p patches 20170104, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 03/13] 9pfs: call v9fs_init_qiov_from_pdu before v9fs_pack, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 01/13] 9pfs: move pdus to V9fsState, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 02/13] 9pfs: introduce transport specific callbacks, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 05/13] 9pfs: fix crash when fsdev is missing,
Greg Kurz <=
- [Qemu-devel] [PULL 06/13] tests: virtio-9p: rename PCI configuration test, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 04/13] 9pfs: introduce init_out/in_iov_from_pdu, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 07/13] tests: virtio-9p: code refactoring, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 08/13] 9pfs: fix P9_NOTAG and P9_NOFID macros, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 11/13] tests: virtio-9p: add walk operation test, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 10/13] tests: virtio-9p: add attach operation test, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 12/13] tests: virtio-9p: no slash in path elements during walk, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 09/13] tests: virtio-9p: add version operation test, Greg Kurz, 2017/01/04
- [Qemu-devel] [PULL 13/13] tests: virtio-9p: ".." cannot be used to walk out of the shared directory, Greg Kurz, 2017/01/04
- Re: [Qemu-devel] [PULL 00/13] 9p patches 20170104, Peter Maydell, 2017/01/05