nfsd: Fix error return code in nfsd_file_cache_init()
authorHuang Guobin <huangguobin4@huawei.com>
Wed, 25 Nov 2020 08:39:33 +0000 (03:39 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Nov 2020 19:45:56 +0000 (14:45 -0500)
Fix to return PTR_ERR() error code from the error handling case instead of
0 in function nfsd_file_cache_init(), as done elsewhere in this function.

Fixes: 65294c1f2c5e7("nfsd: add a new struct file caching facility to nfsd")
Signed-off-by: Huang Guobin <huangguobin4@huawei.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/filecache.c

index 3c6c2f7d1688b43d844019761396e7d9b5046ce1..d77c624c61f62205421eb91cb5c038d74d962977 100644 (file)
@@ -685,6 +685,7 @@ nfsd_file_cache_init(void)
        if (IS_ERR(nfsd_file_fsnotify_group)) {
                pr_err("nfsd: unable to create fsnotify group: %ld\n",
                        PTR_ERR(nfsd_file_fsnotify_group));
+               ret = PTR_ERR(nfsd_file_fsnotify_group);
                nfsd_file_fsnotify_group = NULL;
                goto out_notifier;
        }