fs/file.c: don't open-code kvfree()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2014-04-23 10:18:46 -04:00
parent 38583f095c
commit f6c0a1920e

View File

@ -44,15 +44,10 @@ static void *alloc_fdmem(size_t size)
return vmalloc(size);
}
static void free_fdmem(void *ptr)
{
is_vmalloc_addr(ptr) ? vfree(ptr) : kfree(ptr);
}
static void __free_fdtable(struct fdtable *fdt)
{
free_fdmem(fdt->fd);
free_fdmem(fdt->open_fds);
kvfree(fdt->fd);
kvfree(fdt->open_fds);
kfree(fdt);
}
@ -130,7 +125,7 @@ static struct fdtable * alloc_fdtable(unsigned int nr)
return fdt;
out_arr:
free_fdmem(fdt->fd);
kvfree(fdt->fd);
out_fdt:
kfree(fdt);
out: