summaryrefslogtreecommitdiff
path: root/fs/relayfs/relay.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/relayfs/relay.c')
-rw-r--r--fs/relayfs/relay.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/relayfs/relay.c b/fs/relayfs/relay.c
index 2a6f7f12b7f9..7fbda177ad8f 100644
--- a/fs/relayfs/relay.c
+++ b/fs/relayfs/relay.c
@@ -171,12 +171,17 @@ static struct rchan_buf *relay_open_buf(struct rchan *chan,
struct rchan_buf *buf;
struct dentry *dentry;
+ buf = relay_create_buf(chan);
+ if (!buf)
+ return NULL;
+
/* Create file in fs */
- dentry = relayfs_create_file(filename, parent, S_IRUSR, chan);
- if (!dentry)
+ dentry = relayfs_create_file(filename, parent, S_IRUSR, buf);
+ if (!dentry) {
+ relay_destroy_buf(buf);
return NULL;
+ }
- buf = RELAYFS_I(dentry->d_inode)->buf;
buf->dentry = dentry;
__relay_reset(buf, 1);