Fix warnings with !CONFIG_BLOCK
[firefly-linux-kernel-4.4.55.git] / fs / eventpoll.c
index d4255be29bc69b2d988dba16a2f16f5836272928..77b9953624f480e37d80fb13010fb3e1bc8b3c51 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));
@@ -1327,12 +1324,12 @@ static int __init eventpoll_init(void)
        /* Allocates slab cache used to allocate "struct epitem" items */
        epi_cache = kmem_cache_create("eventpoll_epi", sizeof(struct epitem),
                        0, SLAB_HWCACHE_ALIGN|EPI_SLAB_DEBUG|SLAB_PANIC,
-                       NULL, NULL);
+                       NULL);
 
        /* Allocates slab cache used to allocate "struct eppoll_entry" */
        pwq_cache = kmem_cache_create("eventpoll_pwq",
                        sizeof(struct eppoll_entry), 0,
-                       EPI_SLAB_DEBUG|SLAB_PANIC, NULL, NULL);
+                       EPI_SLAB_DEBUG|SLAB_PANIC, NULL);
 
        return 0;
 }