[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH for 2.10 v2 08/20] vfio/platform: fix use of freed
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH for 2.10 v2 08/20] vfio/platform: fix use of freed memory |
Date: |
Wed, 26 Jul 2017 23:42:13 -0300 |
free the data _after_ using it.
hw/vfio/platform.c:126:29: warning: Use of memory after it is freed
qemu_set_fd_handler(*pfd, NULL, NULL, NULL);
^~~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
hw/vfio/platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 7c09deda61..da84abf4fc 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -120,11 +120,11 @@ static int vfio_set_trigger_eventfd(VFIOINTp *intp,
*pfd = event_notifier_get_fd(intp->interrupt);
qemu_set_fd_handler(*pfd, (IOHandler *)handler, NULL, intp);
ret = ioctl(vbasedev->fd, VFIO_DEVICE_SET_IRQS, irq_set);
- g_free(irq_set);
if (ret < 0) {
error_report("vfio: Failed to set trigger eventfd: %m");
qemu_set_fd_handler(*pfd, NULL, NULL, NULL);
}
+ g_free(irq_set);
return ret;
}
--
2.13.3
- [Qemu-trivial] [PATCH for 2.10 v2 00/20] fix bugs reported by Clang Static Analyzer, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 01/20] tests: add missing dependency to build QTEST_QEMU_BINARY, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 02/20] loader: check get_image_size() return value, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 03/20] ivshmem: fix incorrect error handling in ivshmem_recv_msg(), Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 05/20] qcow2: fix null pointer dereference, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 04/20] nbd: fix memory leak in nbd_opt_go(), Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 06/20] ui/vnc: fix leak of SocketAddress **, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 08/20] vfio/platform: fix use of freed memory,
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH for 2.10 v2 07/20] net/eth: fix incorrect check of iov_to_buf() return value, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 09/20] vfio/pci: fix use of freed memory, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 10/20] m68k/translate: fix incorrect copy/paste, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 11/20] linux-user/sh4: fix incorrect memory write, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 12/20] syscall: fix dereference of undefined pointer, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 13/20] syscall: fix use of uninitialized values, Philippe Mathieu-Daudé, 2017/07/26
- [Qemu-trivial] [PATCH for 2.10 v2 14/20] syscall: check inotify() and eventfd() return value, Philippe Mathieu-Daudé, 2017/07/26