[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/19] event_notifier: avoid dandling file descriptor in event_not
From: |
Laurent Vivier |
Subject: |
[PULL 04/19] event_notifier: avoid dandling file descriptor in event_notifier_cleanup |
Date: |
Fri, 25 Oct 2019 10:34:56 +0200 |
From: Frediano Ziglio <address@hidden>
If rfd is equal to wfd the file descriptor is closed but
rfd will still have the closed value.
The EventNotifier structure should not be used again after calling
event_notifier_cleanup or should be initialized again but make
sure to not have dandling file descriptors around.
Signed-off-by: Frediano Ziglio <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
util/event_notifier-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index 73c4046b5871..00d93204f988 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -80,8 +80,8 @@ void event_notifier_cleanup(EventNotifier *e)
{
if (e->rfd != e->wfd) {
close(e->rfd);
- e->rfd = -1;
}
+ e->rfd = -1;
close(e->wfd);
e->wfd = -1;
}
--
2.21.0
- [PULL 00/19] Trivial branch patches, Laurent Vivier, 2019/10/25
- [PULL 06/19] hw/timer: Compile devices not target-dependent as common object, Laurent Vivier, 2019/10/25
- [PULL 04/19] event_notifier: avoid dandling file descriptor in event_notifier_cleanup,
Laurent Vivier <=
- [PULL 07/19] hw: Move PL031 device from hw/timer/ to hw/rtc/ subdirectory, Laurent Vivier, 2019/10/25
- [PULL 01/19] qemu-options.hx: Update for reboot-timeout parameter, Laurent Vivier, 2019/10/25
- [PULL 03/19] util/async: avoid useless cast, Laurent Vivier, 2019/10/25
- [PULL 05/19] qemu-timer: reuse MIN macro in qemu_timeout_ns_to_ms, Laurent Vivier, 2019/10/25
- [PULL 02/19] pci_bridge: fix a typo in comment, Laurent Vivier, 2019/10/25
- [PULL 10/19] hw: Move M41T80 device from hw/timer/ to hw/rtc/ subdirectory, Laurent Vivier, 2019/10/25
- [PULL 12/19] hw: Move TWL92230 device from hw/timer/ to hw/rtc/ subdirectory, Laurent Vivier, 2019/10/25
- [PULL 15/19] hw: Move Exynos4210 RTC from hw/timer/ to hw/rtc/ subdirectory, Laurent Vivier, 2019/10/25
- [PULL 17/19] hw/rtc/mc146818: Include mc146818rtc_regs.h a bit less, Laurent Vivier, 2019/10/25
- [PULL 11/19] hw: Move sun4v hypervisor RTC from hw/timer/ to hw/rtc/ subdirectory, Laurent Vivier, 2019/10/25