From patchwork Tue Sep 2 14:15:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinglong Mee X-Patchwork-Id: 4826161 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 19A369F3FA for ; Tue, 2 Sep 2014 14:15:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 009EE2016C for ; Tue, 2 Sep 2014 14:15:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA545201B4 for ; Tue, 2 Sep 2014 14:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753628AbaIBOPq (ORCPT ); Tue, 2 Sep 2014 10:15:46 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:49485 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbaIBOPp (ORCPT ); Tue, 2 Sep 2014 10:15:45 -0400 Received: by mail-pa0-f47.google.com with SMTP id hz1so14794428pad.20 for ; Tue, 02 Sep 2014 07:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=zcx0CdyJUwBAvz95iLa+7bCRKoD1TGEuqIuW+w8xEn0=; b=fvBk15YYVXkB1OZFt4XwA4lbxF+OTwNa5aPm6V1J7g0omLsOnfBGymumx7eM9fhJIX 1a0N5vxAAljdxU3lt4ocJqv9ET1N8MY76Ln56SNaT1YndaUy/THg5Eb/UkHOphAaTjWx tmsRlKyNdpCd8ITa/m3bIpJS81+v/8g6XWU+R8UxftgbDA0UI7KBP7Nrb8d0i3Ifp4sH I9MAXfuSNGokL+2ugXmoD0uGsvc5BjS0tzLoIovpfHYR0FfwiRJY2oYq+tgx6UeiEqni h+b/tFJG8iSpA3mRSUcY97y17KBQon469vN+8Wa0mYFtSPrOr3O1Cc9K82AujdJ4YGfa hipw== X-Received: by 10.68.130.5 with SMTP id oa5mr47736242pbb.4.1409667341887; Tue, 02 Sep 2014 07:15:41 -0700 (PDT) Received: from [192.168.0.100] ([171.92.20.104]) by mx.google.com with ESMTPSA id hb1sm4169764pbd.28.2014.09.02.07.15.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2014 07:15:41 -0700 (PDT) Message-ID: <5405D0FE.70008@gmail.com> Date: Tue, 02 Sep 2014 22:15:26 +0800 From: Kinglong Mee User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "J. Bruce Fields" CC: Linux NFS Mailing List , Kinglong Mee Subject: [PATCH 6/6] NFSD: Put export if prepare_creds() fail Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-8.5 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 Signed-off-by: Kinglong Mee --- fs/nfsd/nfsfh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index e883a58..88026fc 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -209,8 +209,10 @@ static __be32 nfsd_set_fh_dentry(struct svc_rqst *rqstp, struct svc_fh *fhp) * fix that case easily. */ struct cred *new = prepare_creds(); - if (!new) - return nfserrno(-ENOMEM); + if (!new) { + error = nfserrno(-ENOMEM); + goto out; + } new->cap_effective = cap_raise_nfsd_set(new->cap_effective, new->cap_permitted);