From patchwork Thu Apr 18 02:49:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2457311 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B25833FD8C for ; Thu, 18 Apr 2013 02:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965102Ab3DRCtL (ORCPT ); Wed, 17 Apr 2013 22:49:11 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:38084 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965054Ab3DRCtK (ORCPT ); Wed, 17 Apr 2013 22:49:10 -0400 Received: by mail-we0-f173.google.com with SMTP id t57so1752249wey.32 for ; Wed, 17 Apr 2013 19:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=tK84S81EAWkuSMbDjrLrLSKspwcb24aFC+2jXq2TqrY=; b=QCb7ZSSR+bvQYkSjMqKvChh54VMNQNn0Q3AhKO0UB4YywJmV37XRgkRxt40WZxzak7 HYFaq01BrIKYwKdPG4oMR3pTLRxoZxo7Yn1iy/kVSJM1dzz6GKuGqWkLC7ukauEzwv5V l7fNftDzykAhPYI2EC+C6QwSRTnyHnsB4ctGEUgOhq0MVVE+sp4KH67II3QIEWRhm78u xq+cJJcAgzlNRiP4XjHq19N2tot/zimTJzq7Rslf4DzI0NSLa7jJ1p6t2Zx4X8B+R2wy EjwxEPk4tcxFuniO4KGai0Rn+U9S0TTjDOG9gA+NbsRi/aOhr//8HAJvA07EJUX8m6L/ uMjA== MIME-Version: 1.0 X-Received: by 10.180.77.10 with SMTP id o10mr30176742wiw.10.1366253349214; Wed, 17 Apr 2013 19:49:09 -0700 (PDT) Received: by 10.194.51.1 with HTTP; Wed, 17 Apr 2013 19:49:09 -0700 (PDT) Date: Thu, 18 Apr 2013 10:49:09 +0800 Message-ID: Subject: [PATCH] svcauth_gss: fix error return code in rsc_parse() From: Wei Yongjun To: bfields@fieldses.org, Trond.Myklebust@netapp.com, ebiederm@xmission.com, skinsbursky@parallels.com, jlayton@redhat.com, simo@redhat.com Cc: yongjun_wei@trendmicro.com.cn, linux-nfs@vger.kernel.org Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Wei Yongjun Fix to return a negative error code from the error handling case instead of 0, as returned elsewhere in this function. Signed-off-by: Wei Yongjun --- net/sunrpc/auth_gss/svcauth_gss.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 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 --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 5ead605..c2156fb 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c @@ -505,8 +505,10 @@ static int rsc_parse(struct cache_detail *cd, len = qword_get(&mesg, buf, mlen); if (len > 0) { rsci.cred.cr_principal = kstrdup(buf, GFP_KERNEL); - if (!rsci.cred.cr_principal) + if (!rsci.cred.cr_principal) { + status = -ENOMEM; goto out; + } } }