[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/8] usb: dev-mtp: close fd in usb_mtp_object_readdir
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 2/8] usb: dev-mtp: close fd in usb_mtp_object_readdir() |
Date: |
Wed, 30 Jan 2019 08:34:20 +0100 |
From: Li Qiang <address@hidden>
Spotted by Coverity: CID 1397070
Signed-off-by: Li Qiang <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
[ kraxel: dropped chunk which adds close() after successful
fdopendir() call, that is not needed according to
POSIX even though Coverity flags it as bug ]
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/dev-mtp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 68c5eb8eaa..837c9d9449 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -666,6 +666,7 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject
*o)
}
dir = fdopendir(fd);
if (!dir) {
+ close(fd);
return;
}
#ifdef CONFIG_INOTIFY1
--
2.9.3
- [Qemu-devel] [PULL 0/8] Usb 20190130 patches, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 2/8] usb: dev-mtp: close fd in usb_mtp_object_readdir(),
Gerd Hoffmann <=
- [Qemu-devel] [PULL 7/8] usb-mtp: breakup MTP write into smaller chunks, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 6/8] usb-mtp: Reallocate buffer in multiples of MTP_WRITE_BUF_SZ, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 1/8] usb: assign unique serial numbers to hid devices, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 8/8] usb-mtp: replace the homebrew write with qemu_write_full, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 4/8] usb: XHCI shall not halt isochronous endpoints, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 5/8] usb: implement XHCI underrun/overrun events, Gerd Hoffmann, 2019/01/30
- [Qemu-devel] [PULL 3/8] hw/usb: Fix LGPL information in the file headers, Gerd Hoffmann, 2019/01/30
- Re: [Qemu-devel] [PULL 0/8] Usb 20190130 patches, Peter Maydell, 2019/01/31
- Re: [Qemu-devel] [PULL 0/8] Usb 20190130 patches, no-reply, 2019/01/31