summaryrefslogtreecommitdiff
path: root/src/common_vgaarb.c
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2009-09-16 12:56:53 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2009-09-18 12:53:20 +0300
commit13c7e6c8f100882718f995f5bf1d478a012cdbdd (patch)
treeb6ccb22c7f18cc6be150b0bbd33deead0436cc1b /src/common_vgaarb.c
parentcdbdfaf61c05d0d18eae6815b10666f93162148f (diff)
downloadlibpciaccess-13c7e6c8f100882718f995f5bf1d478a012cdbdd.tar.gz
libpciaccess-13c7e6c8f100882718f995f5bf1d478a012cdbdd.tar.bz2
libpciaccess-13c7e6c8f100882718f995f5bf1d478a012cdbdd.zip
vgaarb: check for fd before close it
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Diffstat (limited to 'src/common_vgaarb.c')
-rw-r--r--src/common_vgaarb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c
index ca5c0a7..f1c71e0 100644
--- a/src/common_vgaarb.c
+++ b/src/common_vgaarb.c
@@ -150,6 +150,12 @@ pci_device_vgaarb_init(void)
void
pci_device_vgaarb_fini(void)
{
+ if (!pci_sys)
+ return;
+
+ if (!pci_sys->vgaarb_fd)
+ return;
+
close(pci_sys->vgaarb_fd);
}