ocfs2: return ENOMEM when sb_getblk() fails
[platform/adaptation/renesas_rcar/renesas_kernel.git] / fs / ocfs2 / aops.c
index c0d4797..c203600 100644 (file)
@@ -80,6 +80,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
 
        if ((u64)iblock >= ocfs2_clusters_to_blocks(inode->i_sb,
                                                    le32_to_cpu(fe->i_clusters))) {
+               err = -ENOMEM;
                mlog(ML_ERROR, "block offset is outside the allocated size: "
                     "%llu\n", (unsigned long long)iblock);
                goto bail;
@@ -92,6 +93,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
                            iblock;
                buffer_cache_bh = sb_getblk(osb->sb, blkno);
                if (!buffer_cache_bh) {
+                       err = -ENOMEM;
                        mlog(ML_ERROR, "couldn't getblock for symlink!\n");
                        goto bail;
                }