aboutsummaryrefslogtreecommitdiff
path: root/arch/um/drivers
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/drivers
parent730760e90a173ef81f89beed2f1dad2fab310f68 (diff)
[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/drivers')
-rw-r--r--arch/um/drivers/ubd_kern.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 34085315aa5..5fa4c8e258a 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -668,18 +668,15 @@ static int ubd_add(int n)
if(dev->file == NULL)
goto out;
- if (ubd_open_dev(dev))
- goto out;
-
err = ubd_file_size(dev, &dev->size);
if(err < 0)
- goto out_close;
+ goto out;
dev->size = ROUND_BLOCK(dev->size);
err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
if(err)
- goto out_close;
+ goto out;
if(fake_major != MAJOR_NR)
ubd_new_disk(fake_major, dev->size, n,
@@ -691,8 +688,6 @@ static int ubd_add(int n)
make_ide_entries(ubd_gendisk[n]->disk_name);
err = 0;
-out_close:
- ubd_close(dev);
out:
return err;
}