Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3473059pxy; Mon, 26 Apr 2021 02:35:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFvKIuH8uOvVkC23IgcNTXzoc6gmbQV+M30icqTe9fZazjBT0g60jhGb2MH83bmb34jVdC X-Received: by 2002:aa7:c950:: with SMTP id h16mr19931820edt.381.1619429745728; Mon, 26 Apr 2021 02:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619429745; cv=none; d=google.com; s=arc-20160816; b=sFcynwGOPOAxJfcjV/2lwJTPdXUdXx2MPUMkVMxE8lGoKoh1PSp71EdL/KqW6SE2tq hbb6oO6x1iyc57w09f6H/D88se4NRJn5FzTF7DZ65mNuUjANrhCnzyFPToyaavw+AOIq QiyWCUw6Ac2rkJPwUodtS0xbbLp14P2rPgVDpbtRVHyIPZg985pOJ8KvnnKGBUF24hGY YtAcs2ad+QBygMFnEIKv0Rt0jbrgyFc1BPRSJeCZYpHaoaCzy/F6XtGS2J31FnHUr00F BXJTaH8F492ia4FsqA6LxQzrYgL80j1Gmtc4UC+geca240u1J7X+RfjyplCu7soWTI48 XCkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=niKaBm0fsiPscP10644r2Q3dWo6iVxDT9Fvy6uCiNsA=; b=eq8fIB93dZ9IOZjKDFosv1Qszwij0HE5xamoJpXYHau3rHkTzBf2+++s8DqnES7tWW i3ibZD0NhKIsoRfy2s3cZk4QQTxJlJNQlHqh9sX3fKGoSHupUONREtN2lhVYTyMAijlG UBP6dqvY/k88ocETOXTv+aqE9SJNQgVMrjhIJs4IzwS1RnhUgIzLtAo+0EyQSjxKYi3P A658wSal7ho3Y8IpbVG530kZgLtzvqYbDNpx602Bd/psspazbXpsno0XVwIP1wmhAbTI 8fy4e8yU1phl9jz6R/9SSJuG8GwglSPVS4EQzTg3jwte9PQ+/0Jf5bEoPcc7VESG2vAo 5vgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb8si16050619edb.353.2021.04.26.02.35.22; Mon, 26 Apr 2021 02:35:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232140AbhDZJed (ORCPT + 99 others); Mon, 26 Apr 2021 05:34:33 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:53924 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232542AbhDZJeb (ORCPT ); Mon, 26 Apr 2021 05:34:31 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0UWpMjkG_1619429625; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UWpMjkG_1619429625) by smtp.aliyun-inc.com(127.0.0.1); Mon, 26 Apr 2021 17:33:48 +0800 From: Yang Li To: j.vosburgh@gmail.com Cc: vfalico@gmail.com, andy@greyhouse.net, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] bonding/alb: return -ENOMEM when kmalloc failed Date: Mon, 26 Apr 2021 17:33:40 +0800 Message-Id: <1619429620-52948-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver is using -1 instead of the -ENOMEM defined macro to specify that a buffer allocation failed. Using the correct error code is more intuitive. Smatch tool warning: drivers/net/bonding/bond_alb.c:850 rlb_initialize() warn: returning -1 instead of -ENOMEM is sloppy No functional change, just more standardized. Reported-by: Abaci Robot Signed-off-by: Yang Li --- 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 c3091e0..dad5383 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c @@ -847,7 +847,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); -- 1.8.3.1