diff mbox

nfsd: Fix a memory leak when meeting unsupported state_protect_how4

Message ID 56D062FA.7090605@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kinglong Mee Feb. 26, 2016, 2:36 p.m. UTC
Remember free allocated client when meeting unsupported state protect how.

Fixes: 50c7b948adbd ("nfsd: minor consolidation of mach_cred handling code")
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

J. Bruce Fields Feb. 26, 2016, 4:01 p.m. UTC | #1
On Fri, Feb 26, 2016 at 10:36:42PM +0800, Kinglong Mee wrote:
> Remember free allocated client when meeting unsupported state protect how.

Thanks for catching that!

Impact looks minimal for now as it's a leak in a case no current client
exercises, as far as I know.

Queueing up for 4.5.

--b.

> 
> Fixes: 50c7b948adbd ("nfsd: minor consolidation of mach_cred handling code")
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  fs/nfsd/nfs4state.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index c484a2b..9d20c6a 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -2408,7 +2408,8 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
>  	default:				/* checked by xdr code */
>  		WARN_ON_ONCE(1);
>  	case SP4_SSV:
> -		return nfserr_encr_alg_unsupp;
> +		status = nfserr_encr_alg_unsupp;
> +		goto out_nolock;
>  	}
>  
>  	/* Cases below refer to rfc 5661 section 18.35.4: */
> -- 
> 2.5.0
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c484a2b..9d20c6a 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2408,7 +2408,8 @@  nfsd4_exchange_id(struct svc_rqst *rqstp,
 	default:				/* checked by xdr code */
 		WARN_ON_ONCE(1);
 	case SP4_SSV:
-		return nfserr_encr_alg_unsupp;
+		status = nfserr_encr_alg_unsupp;
+		goto out_nolock;
 	}
 
 	/* Cases below refer to rfc 5661 section 18.35.4: */