@@ -886,11 +886,11 @@ struct dentry *
886
886
cifs_smb3_do_mount (struct file_system_type * fs_type ,
887
887
int flags , struct smb3_fs_context * old_ctx )
888
888
{
889
- int rc ;
890
- struct super_block * sb = NULL ;
891
- struct cifs_sb_info * cifs_sb = NULL ;
892
889
struct cifs_mnt_data mnt_data ;
890
+ struct cifs_sb_info * cifs_sb ;
891
+ struct super_block * sb ;
893
892
struct dentry * root ;
893
+ int rc ;
894
894
895
895
if (cifsFYI ) {
896
896
cifs_dbg (FYI , "%s: devname=%s flags=0x%x\n" , __func__ ,
@@ -899,11 +899,9 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
899
899
cifs_info ("Attempting to mount %s\n" , old_ctx -> source );
900
900
}
901
901
902
- cifs_sb = kzalloc (sizeof (struct cifs_sb_info ), GFP_KERNEL );
903
- if (cifs_sb == NULL ) {
904
- root = ERR_PTR (- ENOMEM );
905
- goto out ;
906
- }
902
+ cifs_sb = kzalloc (sizeof (* cifs_sb ), GFP_KERNEL );
903
+ if (!cifs_sb )
904
+ return ERR_PTR (- ENOMEM );
907
905
908
906
cifs_sb -> ctx = kzalloc (sizeof (struct smb3_fs_context ), GFP_KERNEL );
909
907
if (!cifs_sb -> ctx ) {
@@ -940,10 +938,8 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
940
938
941
939
sb = sget (fs_type , cifs_match_super , cifs_set_super , flags , & mnt_data );
942
940
if (IS_ERR (sb )) {
943
- root = ERR_CAST (sb );
944
941
cifs_umount (cifs_sb );
945
- cifs_sb = NULL ;
946
- goto out ;
942
+ return ERR_CAST (sb );
947
943
}
948
944
949
945
if (sb -> s_root ) {
@@ -974,13 +970,9 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
974
970
deactivate_locked_super (sb );
975
971
return root ;
976
972
out :
977
- if (cifs_sb ) {
978
- if (!sb || IS_ERR (sb )) { /* otherwise kill_sb will handle */
979
- kfree (cifs_sb -> prepath );
980
- smb3_cleanup_fs_context (cifs_sb -> ctx );
981
- kfree (cifs_sb );
982
- }
983
- }
973
+ kfree (cifs_sb -> prepath );
974
+ smb3_cleanup_fs_context (cifs_sb -> ctx );
975
+ kfree (cifs_sb );
984
976
return root ;
985
977
}
986
978
0 commit comments