Skip to content

Commit 173b066

Browse files
committed
befs: check return of sb_min_blocksize
Confirm sb_min_blocksize() succeeded before continuing. Link: http://lkml.kernel.org/r/1465700235-22881-1-git-send-email-luisbg@osg.samsung.com Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent c08f1cb commit 173b066

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎fs/befs/linuxvfs.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
756756
long ret = -EINVAL;
757757
const unsigned long sb_block = 0;
758758
const off_t x86_sb_off = 512;
759+
int blocksize;
759760

760761
save_mount_options(sb, data);
761762

@@ -788,7 +789,11 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
788789
* least 1k to get the second 512 bytes of the volume.
789790
* -WD 10-26-01
790791
*/
791-
sb_min_blocksize(sb, 1024);
792+
blocksize = sb_min_blocksize(sb, 1024);
793+
if (!blocksize) {
794+
befs_error(sb, "unable to set blocksize");
795+
goto unacquire_priv_sbp;
796+
}
792797

793798
if (!(bh = sb_bread(sb, sb_block))) {
794799
if (!silent)

0 commit comments

Comments
 (0)