aboutsummaryrefslogtreecommitdiffstats
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,
171 struct rchan_buf *buf; 171 struct rchan_buf *buf;
172 struct dentry *dentry; 172 struct dentry *dentry;
173 173
174 buf = relay_create_buf(chan);
175 if (!buf)
176 return NULL;
177
174 /* Create file in fs */ 178 /* Create file in fs */
175 dentry = relayfs_create_file(filename, parent, S_IRUSR, chan); 179 dentry = relayfs_create_file(filename, parent, S_IRUSR, buf);
176 if (!dentry) 180 if (!dentry) {
181 relay_destroy_buf(buf);
177 return NULL; 182 return NULL;
183 }
178 184
179 buf = RELAYFS_I(dentry->d_inode)->buf;
180 buf->dentry = dentry; 185 buf->dentry = dentry;
181 __relay_reset(buf, 1); 186 __relay_reset(buf, 1);
182 187