Skip to content

Commit

Permalink
nfsd: fix file memleak on client_opens_release
Browse files Browse the repository at this point in the history
commit bc1b5ac 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: 78599c4 ("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>
  • Loading branch information
mngyadam authored and gregkh committed Nov 28, 2023
1 parent a5d4be4 commit 1bb61fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -2799,7 +2799,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 = {
Expand Down

0 comments on commit 1bb61fb

Please sign in to comment.