Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfsd: Drop the client reference in client_states_open()

In error path, call drop_client() to drop the reference
obtained by get_nfsdfs_clp().

Fixes: 78599c42ae3c ("nfsd4: add file to display list of client's opens")
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Haoxiang Li and committed by
Chuck Lever
1f941b2c 8f9e9678

+3 -1
+3 -1
fs/nfsd/nfs4state.c
··· 3099 3099 return -ENXIO; 3100 3100 3101 3101 ret = seq_open(file, &states_seq_ops); 3102 - if (ret) 3102 + if (ret) { 3103 + drop_client(clp); 3103 3104 return ret; 3105 + } 3104 3106 s = file->private_data; 3105 3107 s->private = clp; 3106 3108 return 0;