]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
epoll: move kfree inside ep_free
authorDavide Libenzi <davidel@xmailserver.org>
Tue, 15 May 2007 08:40:57 +0000 (01:40 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 15 May 2007 15:54:00 +0000 (08:54 -0700)
Move the kfree() call inside the ep_free() function.

Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/eventpoll.c

index d4255be29bc69b2d988dba16a2f16f5836272928..0b73cd45a06d6a05a2b37231a39a51cf1b8a8e4e 100644 (file)
@@ -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;
@@ -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));