summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-07-02 16:41:10 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-07-03 13:42:06 -0700
commit1654a0462723b3b75d7a4a20bedfc653cc3e1f1a (patch)
tree92713dae1e4c22c7b62cd46e6abf8201fdda83cb
parentee4e253a3f1a62e2f3f89f5339590fd4e6cde7c4 (diff)
Solaris: Fix fd leak in pci_device_solx_devfs_map_range()
Caching fd's for reuse is most effective when you actually stick the newly opened fd in the cache, instead of letting it leak at the end of the function. Regression introduced by yours truly in commit 9f2d95e61896f41adb. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Randy Fishel <randy.fishel@oracle.com>
-rw-r--r--src/solx_devfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/solx_devfs.c b/src/solx_devfs.c
index 8e7ea9b..f572393 100644
--- a/src/solx_devfs.c
+++ b/src/solx_devfs.c
@@ -724,6 +724,9 @@ pci_device_solx_devfs_map_range(struct pci_device *dev,
strerror(errno));
return err;
}
+#ifndef __sparc
+ xsvc_fd = map_fd;
+#endif
}
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, map_fd, map->base);