From patchwork Fri Feb 26 14:36:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 8437921 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 53F5B9F2F0 for ; Fri, 26 Feb 2016 14:37:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70227203A1 for ; Fri, 26 Feb 2016 14:37:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2DFF2026F for ; Fri, 26 Feb 2016 14:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933591AbcBZOgz (ORCPT ); Fri, 26 Feb 2016 09:36:55 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33810 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932763AbcBZOgy (ORCPT ); Fri, 26 Feb 2016 09:36:54 -0500 Received: by mail-pa0-f52.google.com with SMTP id fy10so51974609pac.1 for ; Fri, 26 Feb 2016 06:36:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=ZcJToHbuAkLBJMstbF0hQjtd3YQfoduaXKaHowIzCho=; b=RNduLzDkwq0yQVvnVh5tMY6bz437JETOmzw0ofute3sIx782aQ+Tr0uQnP8jKGYpzh FfxxqcB3U1CWEVnDQh4wMOIKxDS8x2DeUXVgmoTeeR/ks65JVpvPpG4MYBV6DjndD1vq M3RZxRsPVcE1vEnB2vpNgMzBqMFanZaOJUvJEeIYISLWrgia968L0LerCm9LFLGQNXXK A3ykqmtKk4yO2ngg2V3sFxCtG/d/pZKFoOSEAAMqCS8NS9Uvzxw8pM0W9NGmcHFUcJJs ekV7HfumI/YwSVyohUYjyxmHLgYWkiXDdx/mkRhFoadWyCCtztk34YB95jVRlgMfHfSL 4UnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=ZcJToHbuAkLBJMstbF0hQjtd3YQfoduaXKaHowIzCho=; b=fPCUyPT/TuiS/D4DIIcQvGSdh2/fet5++U2xCDgtxUcY9iGXtyMoCRUcAStKa1JgAU 60dIWfRuM+f6IzkJXXmFKSoO99EO+neZ76x982rhCrXukzXGSJ3i1mulCOoD9GlKJL05 W4HodHfge9VQ0tP8UPLgGKoeEDKopmQJZKiBZj5k014ieRN79DuP55sTkdgF/47aw7ma s2dV54Lv9kPrxXkpeRoe2uMkf5L7fLCkXG/bkeWFI4ylEw9hN1+q6/Fv9LQKP4eNNo+N G3jWV3ITnJvO2Dt+oQEGcCQLcFl6loYiYk/MJzKgNh5PWx7DYK5JUDg6IRmSjoXYmJMj nVLw== X-Gm-Message-State: AD7BkJICSVIQw2zS8KjLXCDWy0MsVV8Fm3PetetFhzpfOnPpQdhCEVah5nBGgrhCQnjMcQ== X-Received: by 10.66.233.131 with SMTP id tw3mr2509738pac.89.1456497414055; Fri, 26 Feb 2016 06:36:54 -0800 (PST) Received: from [192.168.99.19] (li1100-244.members.linode.com. [45.79.1.244]) by smtp.googlemail.com with ESMTPSA id n13sm19965964pfi.3.2016.02.26.06.36.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Feb 2016 06:36:53 -0800 (PST) To: "J. Bruce Fields" Cc: "linux-nfs@vger.kernel.org" , kinglongmee@gmail.com From: Kinglong Mee Subject: [PATCH] nfsd: Fix a memory leak when meeting unsupported state_protect_how4 Message-ID: <56D062FA.7090605@gmail.com> Date: Fri, 26 Feb 2016 22:36:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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: */