Skip to content

Commit

Permalink
fs/file.c: don't open-code kvfree()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 6, 2014
1 parent 38583f0 commit f6c0a19
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f6c0a19

Please sign in to comment.