diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d92360d6bf266543b78b27792ba3d70106d7d6df..1f5ef17f714a72789f2c18baab6b29027eea3913 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5585,8 +5585,10 @@ static int ext4_commit_super(struct super_block *sb) struct buffer_head *sbh = EXT4_SB(sb)->s_sbh; int error = 0; - if (!sbh || block_device_ejected(sb)) - return error; + if (!sbh) + return -EINVAL; + if (block_device_ejected(sb)) + return -ENODEV; ext4_update_super(sb);