From: Tiejun Chen <tiejun.chen@intel.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xen.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH] hw/pci-host/piix: fix one file descriptor leak
Date: Fri, 18 Sep 2015 08:57:10 +0800 [thread overview]
Message-ID: <1442537830-7342-1-git-send-email-tiejun.chen@intel.com> (raw)
Commit 595a4f07d6bd (piix: create host bridge to passthrough)
introduced to leak of one file descriptor, "config_fd", now
just fix that.
CC: Michael S. Tsirkin <mst@redhat.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
hw/pci-host/piix.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 1fb71c8..7d44228 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -775,15 +775,18 @@ static int host_pci_config_read(int pos, int len, uint32_t val)
}
if (lseek(config_fd, pos, SEEK_SET) != pos) {
+ close(config_fd);
return -errno;
}
do {
rc = read(config_fd, (uint8_t *)&val, len);
} while (rc < 0 && (errno == EINTR || errno == EAGAIN));
if (rc != len) {
+ close(config_fd);
return -errno;
}
+ close(config_fd);
return 0;
}
--
1.9.1
reply other threads:[~2015-09-18 0:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442537830-7342-1-git-send-email-tiejun.chen@intel.com \
--to=tiejun.chen@intel.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).