diff options
author | Luis de Bethencourt <luisbg@osg.samsung.com> | 2016-07-27 09:32:52 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2016-07-28 00:56:34 +1000 |
commit | 48235af2c3a3673d60b76d387449ced85b6af70c (patch) | |
tree | 5f71d0189030ca711aa1efcd43278efd8488cc6d | |
parent | 0f5189327ff1ee5f4bceb1643a114fea8ba30008 (diff) | |
download | linux-next-48235af2c3a3673d60b76d387449ced85b6af70c.tar.gz |
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>
-rw-r--r-- | fs/befs/linuxvfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index c734f21fd581..453bb68da219 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -756,6 +756,7 @@ befs_fill_super(struct super_block *sb, void *data, int silent) long ret = -EINVAL; const unsigned long sb_block = 0; const off_t x86_sb_off = 512; + int blocksize; save_mount_options(sb, data); @@ -788,7 +789,11 @@ befs_fill_super(struct super_block *sb, void *data, int silent) * least 1k to get the second 512 bytes of the volume. * -WD 10-26-01 */ - sb_min_blocksize(sb, 1024); + blocksize = sb_min_blocksize(sb, 1024); + if (!blocksize) { + befs_error(sb, "unable to set blocksize"); + goto unacquire_priv_sbp; + } if (!(bh = sb_bread(sb, sb_block))) { if (!silent) |