fd-leak.patch revision 1409
1409N/AFrom 1654a0462723b3b75d7a4a20bedfc653cc3e1f1a Mon Sep 17 00:00:00 2001
1409N/AFrom: Alan Coopersmith <alan.coopersmith@oracle.com>
1409N/ADate: Wed, 2 Jul 2014 16:41:10 -0700
1409N/ASubject: [PATCH:libpciaccess] Solaris: Fix fd leak in
1409N/A pci_device_solx_devfs_map_range()
1409N/A
1409N/ACaching fd's for reuse is most effective when you actually stick the
1409N/Anewly opened fd in the cache, instead of letting it leak at the end
1409N/Aof the function.
1409N/A
1409N/ARegression introduced by yours truly in commit 9f2d95e61896f41adb.
1409N/A
1409N/ASigned-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
1409N/AReviewed-by: Randy Fishel <randy.fishel@oracle.com>
1409N/A---
1409N/A src/solx_devfs.c | 3 +++
1409N/A 1 file changed, 3 insertions(+)
1409N/A
1409N/Adiff --git a/src/solx_devfs.c b/src/solx_devfs.c
1409N/Aindex 8e7ea9b..f572393 100644
1409N/A--- a/src/solx_devfs.c
1409N/A+++ b/src/solx_devfs.c
1409N/A@@ -724,6 +724,9 @@ pci_device_solx_devfs_map_range(struct pci_device *dev,
1409N/A strerror(errno));
1409N/A return err;
1409N/A }
1409N/A+#ifndef __sparc
1409N/A+ xsvc_fd = map_fd;
1409N/A+#endif
1409N/A }
1409N/A
1409N/A map->memory = mmap(NULL, map->size, prot, MAP_SHARED, map_fd, map->base);
1409N/A--
1409N/A1.7.9.2
1409N/A