]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2024 12:52:33 +0000 (14:52 +0200)
[ Upstream commit 231307df246eb29f30092836524ebb1fcb8f5b25 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/filecache.c

index e30e1ddc1aceb571683f7c6a8442b959de48557a..d0748ff04b92f30a5d6d0ca32176c32cda98ac0b 100644 (file)
@@ -684,6 +684,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;
        }