Skip to content

Commit

Permalink
epoll: move kfree inside ep_free
Browse files Browse the repository at this point in the history
Move the kfree() call inside the ep_free() function.

Signed-off-by: Davide Libenzi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
davidel authored and Linus Torvalds committed May 15, 2007
1 parent 67647d0 commit f0ee9aa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/eventpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,18 +469,16 @@ static void ep_free(struct eventpoll *ep)
}

mutex_unlock(&epmutex);

mutex_destroy(&ep->mtx);
kfree(ep);
}

static int ep_eventpoll_release(struct inode *inode, struct file *file)
{
struct eventpoll *ep = file->private_data;

if (ep) {
if (ep)
ep_free(ep);
kfree(ep);
}

DNPRINTK(3, (KERN_INFO "[%p] eventpoll: close() ep=%p\n", current, ep));
return 0;
Expand Down Expand Up @@ -1107,7 +1105,6 @@ asmlinkage long sys_epoll_create(int size)

error_free:
ep_free(ep);
kfree(ep);
error_return:
DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
current, size, error));
Expand Down

0 comments on commit f0ee9aa

Please sign in to comment.