]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfsd: fix file memleak on client_opens_release
authorMahmoud Adam <mngyadam@amazon.com>
Fri, 10 Nov 2023 18:21:04 +0000 (19:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:34 +0000 (16:56 +0000)
commit bc1b5acb40201a0746d68a7d7cfc141899937f4f upstream.

seq_release should be called to free the allocated seq_file

Cc: stable@vger.kernel.org # v5.3+
Signed-off-by: Mahmoud Adam <mngyadam@amazon.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens")
Reviewed-by: NeilBrown <neilb@suse.de>
Tested-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4state.c

index f54ef526f25d0132b7cc091a80e4860aa48e0950..9b660491f393113b6f056d003173c74edfc4ee19 100644 (file)
@@ -2686,7 +2686,7 @@ static int client_opens_release(struct inode *inode, struct file *file)
 
        /* XXX: alternatively, we could get/drop in seq start/stop */
        drop_client(clp);
-       return 0;
+       return seq_release(inode, file);
 }
 
 static const struct file_operations client_states_fops = {