From: Michael Holzheu Date: Wed, 20 Sep 2006 14:00:04 +0000 (+0200) Subject: [S390] hypfs crashes with invalid mount option. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=388c571cffc4ae4e64f0786333e811308acbbc10;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [S390] hypfs crashes with invalid mount option. When an invalid mount option is specified, no root inode is created for hypfs, hypfs_fill_super() returns with -EINVAL and then hypfs_kill_super() is called. hypfs_kill_super() does not check if the root inode has been initialized. This patch adds this check. Signed-off-by: Michael Holzheu Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index bdcad2ea1ff4..bdade5f2e325 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -312,10 +312,12 @@ static void hypfs_kill_super(struct super_block *sb) { struct hypfs_sb_info *sb_info = sb->s_fs_info; - hypfs_delete_tree(sb->s_root); - hypfs_remove(sb_info->update_file); - kfree(sb->s_fs_info); - sb->s_fs_info = NULL; + if (sb->s_root) { + hypfs_delete_tree(sb->s_root); + hypfs_remove(sb_info->update_file); + kfree(sb->s_fs_info); + sb->s_fs_info = NULL; + } kill_litter_super(sb); }