From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D12DEC433F5 for ; Thu, 23 Sep 2021 20:05:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B197C61241 for ; Thu, 23 Sep 2021 20:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243091AbhIWUGk (ORCPT ); Thu, 23 Sep 2021 16:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242982AbhIWUGj (ORCPT ); Thu, 23 Sep 2021 16:06:39 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14BB4C061574; Thu, 23 Sep 2021 13:05:08 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id F34BA7028; Thu, 23 Sep 2021 16:05:06 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org F34BA7028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1632427506; bh=RA7LytCbQ/iS3aTI2O+4kY53kpLk048y3sZRj3y3SoQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ccHyZQ5r/DLwz/dKwnM2ivzA9V2Hsx5GPruga9JZl9f4QhV2o2cMH0PgyswNnOD9J GQYpWNgJxLhG9P3ttahx2s5WKehqjLvJjzOtlbDJOcpkho3kg1/KGAQdOiGD9nnrOV AwmF8aXzV4ZkL8ML46hdJmCjPi3PtRg9uDnq2HPM= Date: Thu, 23 Sep 2021 16:05:06 -0400 From: "J. Bruce Fields" To: Yang Li Cc: kuba@kernel.org, davem@davemloft.net, anna.schumaker@netapp.com, trond.myklebust@hammerspace.com, chuck.lever@oracle.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] UNRPC: Return specific error code on kmalloc failure Message-ID: <20210923200506.GF18334@fieldses.org> References: <1631266404-29698-1-git-send-email-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1631266404-29698-1-git-send-email-yang.lee@linux.alibaba.com> User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Sep 10, 2021 at 05:33:24PM +0800, Yang Li wrote: > Although the callers of this function only care about whether the > return value is null or not, we should still give a rigorous > error code. Eh, I'm not sure I understand why this is important but, OK, applying.--b. > > Smatch tool warning: > net/sunrpc/auth_gss/svcauth_gss.c:784 gss_write_verf() warn: returning > -1 instead of -ENOMEM is sloppy > > No functional change, just more standardized. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > net/sunrpc/auth_gss/svcauth_gss.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c > index 3e776e3..7dba6a9 100644 > --- a/net/sunrpc/auth_gss/svcauth_gss.c > +++ b/net/sunrpc/auth_gss/svcauth_gss.c > @@ -781,7 +781,7 @@ static inline u32 round_up_to_quad(u32 i) > svc_putnl(rqstp->rq_res.head, RPC_AUTH_GSS); > xdr_seq = kmalloc(4, GFP_KERNEL); > if (!xdr_seq) > - return -1; > + return -ENOMEM; > *xdr_seq = htonl(seq); > > iov.iov_base = xdr_seq; > -- > 1.8.3.1