diff options
Diffstat (limited to 'fs/proc/fd.c')
-rw-r--r-- | fs/proc/fd.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 1441f143c43b..75f2890abbd8 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c | |||
@@ -167,11 +167,10 @@ static int proc_fd_link(struct dentry *dentry, struct path *path) | |||
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | 169 | ||
170 | static struct dentry * | 170 | static int |
171 | proc_fd_instantiate(struct inode *dir, struct dentry *dentry, | 171 | proc_fd_instantiate(struct inode *dir, struct dentry *dentry, |
172 | struct task_struct *task, const void *ptr) | 172 | struct task_struct *task, const void *ptr) |
173 | { | 173 | { |
174 | struct dentry *error = ERR_PTR(-ENOENT); | ||
175 | unsigned fd = (unsigned long)ptr; | 174 | unsigned fd = (unsigned long)ptr; |
176 | struct proc_inode *ei; | 175 | struct proc_inode *ei; |
177 | struct inode *inode; | 176 | struct inode *inode; |
@@ -194,9 +193,9 @@ proc_fd_instantiate(struct inode *dir, struct dentry *dentry, | |||
194 | 193 | ||
195 | /* Close the race of the process dying before we return the dentry */ | 194 | /* Close the race of the process dying before we return the dentry */ |
196 | if (tid_fd_revalidate(dentry, 0)) | 195 | if (tid_fd_revalidate(dentry, 0)) |
197 | error = NULL; | 196 | return 0; |
198 | out: | 197 | out: |
199 | return error; | 198 | return -ENOENT; |
200 | } | 199 | } |
201 | 200 | ||
202 | static struct dentry *proc_lookupfd_common(struct inode *dir, | 201 | static struct dentry *proc_lookupfd_common(struct inode *dir, |
@@ -204,7 +203,7 @@ static struct dentry *proc_lookupfd_common(struct inode *dir, | |||
204 | instantiate_t instantiate) | 203 | instantiate_t instantiate) |
205 | { | 204 | { |
206 | struct task_struct *task = get_proc_task(dir); | 205 | struct task_struct *task = get_proc_task(dir); |
207 | struct dentry *result = ERR_PTR(-ENOENT); | 206 | int result = -ENOENT; |
208 | unsigned fd = name_to_int(dentry); | 207 | unsigned fd = name_to_int(dentry); |
209 | 208 | ||
210 | if (!task) | 209 | if (!task) |
@@ -216,7 +215,7 @@ static struct dentry *proc_lookupfd_common(struct inode *dir, | |||
216 | out: | 215 | out: |
217 | put_task_struct(task); | 216 | put_task_struct(task); |
218 | out_no_task: | 217 | out_no_task: |
219 | return result; | 218 | return ERR_PTR(result); |
220 | } | 219 | } |
221 | 220 | ||
222 | static int proc_readfd_common(struct file *file, struct dir_context *ctx, | 221 | static int proc_readfd_common(struct file *file, struct dir_context *ctx, |
@@ -300,11 +299,10 @@ const struct inode_operations proc_fd_inode_operations = { | |||
300 | .setattr = proc_setattr, | 299 | .setattr = proc_setattr, |
301 | }; | 300 | }; |
302 | 301 | ||
303 | static struct dentry * | 302 | static int |
304 | proc_fdinfo_instantiate(struct inode *dir, struct dentry *dentry, | 303 | proc_fdinfo_instantiate(struct inode *dir, struct dentry *dentry, |
305 | struct task_struct *task, const void *ptr) | 304 | struct task_struct *task, const void *ptr) |
306 | { | 305 | { |
307 | struct dentry *error = ERR_PTR(-ENOENT); | ||
308 | unsigned fd = (unsigned long)ptr; | 306 | unsigned fd = (unsigned long)ptr; |
309 | struct proc_inode *ei; | 307 | struct proc_inode *ei; |
310 | struct inode *inode; | 308 | struct inode *inode; |
@@ -324,9 +322,9 @@ proc_fdinfo_instantiate(struct inode *dir, struct dentry *dentry, | |||
324 | 322 | ||
325 | /* Close the race of the process dying before we return the dentry */ | 323 | /* Close the race of the process dying before we return the dentry */ |
326 | if (tid_fd_revalidate(dentry, 0)) | 324 | if (tid_fd_revalidate(dentry, 0)) |
327 | error = NULL; | 325 | return 0; |
328 | out: | 326 | out: |
329 | return error; | 327 | return -ENOENT; |
330 | } | 328 | } |
331 | 329 | ||
332 | static struct dentry * | 330 | static struct dentry * |