File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -838,7 +838,7 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
838
838
int flags , struct smb3_fs_context * old_ctx )
839
839
{
840
840
int rc ;
841
- struct super_block * sb ;
841
+ struct super_block * sb = NULL ;
842
842
struct cifs_sb_info * cifs_sb = NULL ;
843
843
struct cifs_mnt_data mnt_data ;
844
844
struct dentry * root ;
@@ -934,9 +934,11 @@ cifs_smb3_do_mount(struct file_system_type *fs_type,
934
934
return root ;
935
935
out :
936
936
if (cifs_sb ) {
937
- kfree (cifs_sb -> prepath );
938
- smb3_cleanup_fs_context (cifs_sb -> ctx );
939
- kfree (cifs_sb );
937
+ if (!sb || IS_ERR (sb )) { /* otherwise kill_sb will handle */
938
+ kfree (cifs_sb -> prepath );
939
+ smb3_cleanup_fs_context (cifs_sb -> ctx );
940
+ kfree (cifs_sb );
941
+ }
940
942
}
941
943
return root ;
942
944
}
You can’t perform that action at this time.
0 commit comments