Commit f6c0a192 authored by Al Viro's avatar Al Viro

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

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 38583f09
...@@ -44,15 +44,10 @@ static void *alloc_fdmem(size_t size) ...@@ -44,15 +44,10 @@ static void *alloc_fdmem(size_t size)
return vmalloc(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) static void __free_fdtable(struct fdtable *fdt)
{ {
free_fdmem(fdt->fd); kvfree(fdt->fd);
free_fdmem(fdt->open_fds); kvfree(fdt->open_fds);
kfree(fdt); kfree(fdt);
} }
...@@ -130,7 +125,7 @@ static struct fdtable * alloc_fdtable(unsigned int nr) ...@@ -130,7 +125,7 @@ static struct fdtable * alloc_fdtable(unsigned int nr)
return fdt; return fdt;
out_arr: out_arr:
free_fdmem(fdt->fd); kvfree(fdt->fd);
out_fdt: out_fdt:
kfree(fdt); kfree(fdt);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment