Message ID | 20090619185127.31118.2893.stgit@dev.haskins.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/eventfd.c b/fs/eventfd.c index 2a701d5..c71f51d 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -59,7 +59,15 @@ int eventfd_signal(struct file *file, int n) static int eventfd_release(struct inode *inode, struct file *file) { - kfree(file->private_data); + struct eventfd_ctx *ctx = file->private_data; + + /* + * No need to hold the lock here, since we are on the file cleanup + * path and the ones still attached to the wait queue will be + * serialized by wake_up_locked_poll(). + */ + wake_up_locked_poll(&ctx->wqh, POLLHUP); + kfree(ctx); return 0; }