summaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-29 01:58:51 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 09:18:04 -0700
commit80c13749140284abdc23bbeed2507b7e5a3dc459 (patch)
tree9d5a56f718e8f467af3daf0089309d3b1ac9d12e /arch/um/os-Linux
parent730760e90a173ef81f89beed2f1dad2fab310f68 (diff)
downloadblackbird-op-linux-80c13749140284abdc23bbeed2507b7e5a3dc459.tar.gz
blackbird-op-linux-80c13749140284abdc23bbeed2507b7e5a3dc459.zip
[PATCH] uml: close file descriptor leaks
Close two file descriptor leaks, one in the ubd driver and one to /proc/mounts. The ubd driver bug also leaked some vmalloc space. The /proc/mounts leak was a descriptor that was just never closed. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/mem.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c
index b170b4704dc4..4203681e508d 100644
--- a/arch/um/os-Linux/mem.c
+++ b/arch/um/os-Linux/mem.c
@@ -132,6 +132,9 @@ err:
else if(found < 0)
printf("read returned errno %d\n", -found);
+out:
+ close(fd);
+
return;
found:
@@ -141,11 +144,12 @@ found:
if(strncmp(buf, "tmpfs", strlen("tmpfs"))){
printf("not tmpfs\n");
- return;
+ goto out;
}
printf("OK\n");
default_tmpdir = "/dev/shm";
+ goto out;
}
/*
OpenPOWER on IntegriCloud