Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1292071rwb; Thu, 11 Aug 2022 20:47:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR7/YjGpiFQiywAByxQmaa+eOdxEJJgT+kGf2zmMhkYg6rXA4TyCZdz3V8juB5k7S70adwYa X-Received: by 2002:a63:f5d:0:b0:41d:54a1:ede0 with SMTP id 29-20020a630f5d000000b0041d54a1ede0mr1705069pgp.74.1660276033582; Thu, 11 Aug 2022 20:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660276033; cv=none; d=google.com; s=arc-20160816; b=ZX5+X/Y4sjY0uq9Bhk0e6HEq5BQGNZukzAGjdwe98WT7FtKCCyXXFVGwoYdeQhtdQk WNFWYKH4ZMV0qYii9HJpyGAqVn47jh+i9LCZtOPuE8ffIwZGqAFDP8ZZ7H2Tq/zDv7gB /seIyZJRiG1vYaWQ/Kgh6OhNbv6I7QTVSv4EWTFIjGs/1Vf1w9YvZ9RHzM4Zw2nU8Igz xDKY7cTx5JBgwdNBRws8SGZC7cM287rkEFvQ/eCvjtVPnSvBmx0sX16gD3wgG0R7sHL6 7SEQUbuhoVbKfA1jXdtiwQiUEXzkjf4MFsjzEnu/tW4qsxbjZcwNRNdIXvJUjX+dC4+9 AeRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2voaRO3M59RNvvS14xmHKKpuTXvbaKpz6hxLPZSPAbc=; b=wRD2T0RfIC0N4DD3nqYqHsJvASm6Z/4//MPklMWuWNP0sTKtI3ktgjv3JfcUj3zgUn rcFFIZePmjwuu3WQVx3qEbbsWuAL/aMc/azBRcg+oQKZcNMPzH7wlOCxKSdq8StF0pDk VTOerjKQfgeUXGPe6L4zbSP2pqKeXhQMPgInOWBD79Ke5WNbF+4MdCo/sdfAQNvxmv/p QCHaVBgIf53C0xGeigDp4+rj3DZI1+4iY+1UW4EbUgbM+tRUGKBLuhaydqm0rBYeb9ZY 9TWE7kmGY1hUW0ZGiVrrsFm+hUswcFKg7BltS85P1jgNYn3ej7Pto0mdq89lUmxJjGB8 N4gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a170902d48c00b0016eedde8ecdsi1288522plg.155.2022.08.11.20.46.59; Thu, 11 Aug 2022 20:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236270AbiHLDVr (ORCPT + 99 others); Thu, 11 Aug 2022 23:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiHLDVb (ORCPT ); Thu, 11 Aug 2022 23:21:31 -0400 Received: from out199-12.us.a.mail.aliyun.com (out199-12.us.a.mail.aliyun.com [47.90.199.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6952CA3448; Thu, 11 Aug 2022 20:21:28 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VM.yJQ7_1660274470; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VM.yJQ7_1660274470) by smtp.aliyun-inc.com; Fri, 12 Aug 2022 11:21:23 +0800 From: Jiapeng Chong To: j.vosburgh@gmail.com Cc: vfalico@gmail.com, andy@greyhouse.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] bonding: return -ENOMEM on rlb_initialize() allocation failure Date: Fri, 12 Aug 2022 11:20:59 +0800 Message-Id: <20220812032059.64572-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/net/bonding/bond_alb.c:861 rlb_initialize() warn: returning -1 instead of -ENOMEM is sloppy. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1896 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/net/bonding/bond_alb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 60cb9a0225aa..96cb4404b3c7 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -858,7 +858,7 @@ static int rlb_initialize(struct bonding *bond) new_hashtbl = kmalloc(size, GFP_KERNEL); if (!new_hashtbl) - return -1; + return -ENOMEM; spin_lock_bh(&bond->mode_lock); -- 2.20.1.7.g153144c