From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GzY-0003gc-11 for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9GzS-0006Ud-Cq for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:27 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:52944) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GzS-0006T2-5C for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:22 -0500 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 10:35:21 -0700 From: Michael Roth Date: Thu, 8 Jan 2015 11:33:28 -0600 Message-Id: <1420738472-23267-25-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 24/88] ivshmem: Fix fd leak on error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Andreas Färber Reported-by: Stefan Hajnoczi Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber Reviewed-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini (cherry picked from commit 3a31cff11203bf62ebafa6d74b1fcf2aba345eed) Signed-off-by: Michael Roth --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index c3dc5c3..7252f64 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -508,6 +508,7 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size) if (incoming_fd == -1) { fprintf(stderr, "could not allocate file descriptor %s\n", strerror(errno)); + close(tmp_fd); return; } -- 1.9.1