diff options
-rw-r--r-- | fs/9p/vfs_inode.c | 13 |
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 | ||
366 | error: | 363 | error: |
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 | ||