From: fanchaoting Date: Wed, 27 Mar 2013 08:31:18 +0000 (+0800) Subject: nfsd: remove /proc/fs/nfs when create /proc/fs/nfs/exports error X-Git-Tag: v3.10-rc1~6^2~42 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff7c4b3693cbc7e938f49ed89e2f649a33f03ed1;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Reviewed-by: chendt.fnst Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index a830f33..68a4d32 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1111,8 +1111,10 @@ static int create_proc_exports_entry(void) return -ENOMEM; entry = proc_create("exports", 0, entry, &exports_proc_operations); - if (!entry) + if (!entry) { + remove_proc_entry("fs/nfs", NULL); return -ENOMEM; + } return 0; } #else /* CONFIG_PROC_FS */