aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAbhishek Kulkarni <adkulkar@umail.iu.edu>2009-07-19 15:41:54 -0400
committerEric Van Hensbergen <ericvh@strongmad.austin.ibm.com>2009-08-17 17:27:57 -0400
commit02bc35672b2fdf251e264adca5407792f63191e4 (patch)
tree301e2d999daed7afd11596bc89087750a4509e1c /fs
parent0e15597ebfe00e28857185f46aba00f400480ffe (diff)
9p: Fix possible memleak in v9fs_inode_from fid.
Add missing p9stat_free in v9fs_inode_from_fid to avoid any possible leaks. Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/9p/vfs_inode.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index f22668afd0d6..fac30d21851f 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -344,30 +344,25 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid,
344 344
345 ret = NULL; 345 ret = NULL;
346 st = p9_client_stat(fid); 346 st = p9_client_stat(fid);
347 if (IS_ERR(st)) { 347 if (IS_ERR(st))
348 err = PTR_ERR(st); 348 return ERR_CAST(st);
349 st = NULL;
350 goto error;
351 }
352 349
353 umode = p9mode2unixmode(v9ses, st->mode); 350 umode = p9mode2unixmode(v9ses, st->mode);
354 ret = v9fs_get_inode(sb, umode); 351 ret = v9fs_get_inode(sb, umode);
355 if (IS_ERR(ret)) { 352 if (IS_ERR(ret)) {
356 err = PTR_ERR(ret); 353 err = PTR_ERR(ret);
357 ret = NULL;
358 goto error; 354 goto error;
359 } 355 }
360 356
361 v9fs_stat2inode(st, ret, sb); 357 v9fs_stat2inode(st, ret, sb);
362 ret->i_ino = v9fs_qid2ino(&st->qid); 358 ret->i_ino = v9fs_qid2ino(&st->qid);
359 p9stat_free(st);
363 kfree(st); 360 kfree(st);
364 return ret; 361 return ret;
365 362
366error: 363error:
364 p9stat_free(st);
367 kfree(st); 365 kfree(st);
368 if (ret)
369 iput(ret);
370
371 return ERR_PTR(err); 366 return ERR_PTR(err);
372} 367}
373 368