@@ -805,16 +805,18 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
805
805
int err ;
806
806
int is_bdev = sb -> s_bdev != NULL ;
807
807
808
+ err = - EINVAL ;
808
809
if (sb -> s_flags & MS_MANDLOCK )
809
- return - EINVAL ;
810
+ goto err ;
810
811
811
812
if (!parse_fuse_opt ((char * ) data , & d , is_bdev ))
812
- return - EINVAL ;
813
+ goto err ;
813
814
814
815
if (is_bdev ) {
815
816
#ifdef CONFIG_BLOCK
817
+ err = - EINVAL ;
816
818
if (!sb_set_blocksize (sb , d .blksize ))
817
- return - EINVAL ;
819
+ goto err ;
818
820
#endif
819
821
} else {
820
822
sb -> s_blocksize = PAGE_CACHE_SIZE ;
@@ -826,25 +828,22 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
826
828
sb -> s_export_op = & fuse_export_operations ;
827
829
828
830
file = fget (d .fd );
831
+ err = - EINVAL ;
829
832
if (!file )
830
- return - EINVAL ;
833
+ goto err ;
831
834
832
- if (file -> f_op != & fuse_dev_operations ) {
833
- fput (file );
834
- return - EINVAL ;
835
- }
835
+ if (file -> f_op != & fuse_dev_operations )
836
+ goto err_fput ;
836
837
837
838
fc = kmalloc (sizeof (* fc ), GFP_KERNEL );
838
- if (!fc ) {
839
- fput (file );
840
- return - ENOMEM ;
841
- }
839
+ err = - ENOMEM ;
840
+ if (!fc )
841
+ goto err_fput ;
842
842
843
843
err = fuse_conn_init (fc , sb );
844
844
if (err ) {
845
- fput (file );
846
845
kfree (fc );
847
- return err ;
846
+ goto err_fput ;
848
847
}
849
848
850
849
fc -> release = fuse_free_conn ;
@@ -859,12 +858,12 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
859
858
err = - ENOMEM ;
860
859
root = fuse_get_root_inode (sb , d .rootmode );
861
860
if (!root )
862
- goto err ;
861
+ goto err_put_conn ;
863
862
864
863
root_dentry = d_alloc_root (root );
865
864
if (!root_dentry ) {
866
865
iput (root );
867
- goto err ;
866
+ goto err_put_conn ;
868
867
}
869
868
870
869
init_req = fuse_request_alloc ();
@@ -908,9 +907,11 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
908
907
fuse_request_free (init_req );
909
908
err_put_root :
910
909
dput (root_dentry );
911
- err :
912
- fput (file );
910
+ err_put_conn :
913
911
fuse_conn_put (fc );
912
+ err_fput :
913
+ fput (file );
914
+ err :
914
915
return err ;
915
916
}
916
917
0 commit comments