Skip to content

Commit 26808d3

Browse files
author
J. Bruce Fields
committed
nfsd: cleanup nfsd module initialization cleanup
Handle the failure case here with something closer to the standard kernel style. Doesn't really matter for now, but I'd like to add a few more failure cases, and then this'll help. Acked-by: NeilBrown <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 46b2589 commit 26808d3

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

fs/nfsd/nfsctl.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -694,16 +694,18 @@ static int __init init_nfsd(void)
694694
entry->proc_fops = &exports_operations;
695695
}
696696
retval = register_filesystem(&nfsd_fs_type);
697-
if (retval) {
698-
nfsd_idmap_shutdown();
699-
nfsd_export_shutdown();
700-
nfsd_cache_shutdown();
701-
remove_proc_entry("fs/nfs/exports", NULL);
702-
remove_proc_entry("fs/nfs", NULL);
703-
nfsd_stat_shutdown();
704-
nfsd_lockd_shutdown();
705-
nfsd4_free_slabs();
706-
}
697+
if (retval)
698+
goto out_free_all;
699+
return 0;
700+
out_free_all:
701+
nfsd_idmap_shutdown();
702+
nfsd_export_shutdown();
703+
nfsd_cache_shutdown();
704+
remove_proc_entry("fs/nfs/exports", NULL);
705+
remove_proc_entry("fs/nfs", NULL);
706+
nfsd_stat_shutdown();
707+
nfsd_lockd_shutdown();
708+
nfsd4_free_slabs();
707709
return retval;
708710
}
709711

0 commit comments

Comments
 (0)