summaryrefslogtreecommitdiffstats
path: root/fs/ext4/symlink.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fs/ext4/symlink.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
index 75bf1f8884..645240cc02 100644
--- a/fs/ext4/symlink.c
+++ b/fs/ext4/symlink.c
@@ -92,10 +92,12 @@ static const char *ext4_get_link(struct dentry *dentry, struct inode *inode,
if (!dentry) {
bh = ext4_getblk(NULL, inode, 0, EXT4_GET_BLOCKS_CACHED_NOWAIT);
- if (IS_ERR(bh))
- return ERR_CAST(bh);
- if (!bh || !ext4_buffer_uptodate(bh))
+ if (IS_ERR(bh) || !bh)
return ERR_PTR(-ECHILD);
+ if (!ext4_buffer_uptodate(bh)) {
+ brelse(bh);
+ return ERR_PTR(-ECHILD);
+ }
} else {
bh = ext4_bread(NULL, inode, 0, 0);
if (IS_ERR(bh))