aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorfanchaoting <fanchaoting@cn.fujitsu.com>2013-03-27 04:31:18 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-04-03 15:30:07 -0400
commitff7c4b3693cbc7e938f49ed89e2f649a33f03ed1 (patch)
treee7079a5312d548e807c2f0fc68cccd44c421db42 /fs/nfsd
parentb022032e195ffca83d7002d6b84297d796ed443b (diff)
nfsd: remove /proc/fs/nfs when create /proc/fs/nfs/exports error
when create /proc/fs/nfs/exports error, we should remove /proc/fs/nfs, if don't do it, it maybe cause Memory leak. Signed-off-by: fanchaoting <fanchaoting@cn.fujitsu.com> Reviewed-by: chendt.fnst <chendt.fnst@cn.fujitsu.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfsctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index a830f33df3ef..68a4d320cd14 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1111,8 +1111,10 @@ static int create_proc_exports_entry(void)
1111 return -ENOMEM; 1111 return -ENOMEM;
1112 entry = proc_create("exports", 0, entry, 1112 entry = proc_create("exports", 0, entry,
1113 &exports_proc_operations); 1113 &exports_proc_operations);
1114 if (!entry) 1114 if (!entry) {
1115 remove_proc_entry("fs/nfs", NULL);
1115 return -ENOMEM; 1116 return -ENOMEM;
1117 }
1116 return 0; 1118 return 0;
1117} 1119}
1118#else /* CONFIG_PROC_FS */ 1120#else /* CONFIG_PROC_FS */