Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp3981515rwb; Sun, 30 Jul 2023 22:01:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGNBKyoLfLl5oSB58W4i5KLlqMyd2Zl4q2vSsHRRik9CHtGT1Q4rQymUmnr3fHuSyrU6pMO X-Received: by 2002:a05:6808:1893:b0:3a3:63b8:fdc7 with SMTP id bi19-20020a056808189300b003a363b8fdc7mr9619734oib.38.1690779690515; Sun, 30 Jul 2023 22:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690779690; cv=none; d=google.com; s=arc-20160816; b=JRCxojVkVTcC/wkd6SgJym1cPnpeARQByGXRmRt/iMT8WVU647djvrj8xEb/EayQuB y5a0KEofIo46Br6OBuAQHmD/uIW21iBO3wJ1D0u9cu8kzLGTXc8oVN6LI8KfAIp+CC7q ZhsqVl0bbFDSwYmoPtQv8p/khFxGQsjMVE9dbH2yLJ4z34oN3ZSsaM7JwnhYAxJsukH/ D81AG3y0YuuS3aIgDRrv5tloymiKPdptGgxKoAp2aCXKFWInB9lngVGvsXLtzTOUQa6H gQfhpFQqss+4HmBLwV6kBc35pZF6EUq1opUAjSeERnX2o0qBKWTXRk8ru3tJsIoTyRH9 uTbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iecctykKTsm0q82UtUMIa1inbPuKOlOwMPntbBWiA7M=; fh=Bksfz7s/0m4oU/sbTZZOT0d6RJMEElcqjL2VHJlth/g=; b=Cj/8TjUSPn0kXA1cvVDwgFqWXbmwua3hc+JLUX7Q8fns2agia0wdrV7QM/haK7fvlA t2UdZwHCwiXX/0c4gd7DIhtWONaRRSrclrWmtMtZTjmPzGQV9zK+/iFwqOTOCMnpkpsd ysfp9sXMHErzcKeemsHFG3YjqRM5KTN2JZcfIoUr71NmQcvIJLzcTnM+z2cjwugLvQ7L Rly14HC2v0lF33L8+K2hypQlQEesShQ6c9ShAgIf/ZecHr+gp1voY5rTvgXvraIxJ6by 54GkfKI35m6+2flfLhxQnDXnUff+0iPVcxUsDKz18ilWu1KfN7UYUJ9UnFpuXxNTePnv 2srg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Qgw6X8Pg; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ky12-20020a170902f98c00b001bbb8a65e87si5793528plb.59.2023.07.30.22.01.17; Sun, 30 Jul 2023 22:01:30 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Qgw6X8Pg; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbjGaEHI (ORCPT + 99 others); Mon, 31 Jul 2023 00:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjGaEHF (ORCPT ); Mon, 31 Jul 2023 00:07:05 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32CA91B7; Sun, 30 Jul 2023 21:07:01 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-686ba97e4feso4110893b3a.0; Sun, 30 Jul 2023 21:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690776420; x=1691381220; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iecctykKTsm0q82UtUMIa1inbPuKOlOwMPntbBWiA7M=; b=Qgw6X8PgM/yfApdep7jdZxiutuZFmm49igDyyAElEToLnI5m+Oe9Z3oV6VNYiJd3wL M+N8yizMMU2TB4wmdiNwMJHWxemWNtsjoKSHjgJAJCAkUVPLRXm00JKXFXCHszONNvEO 1+HZ9gG+lB3lymrNLclKzCnF9dwSS8lhhC/WekeJumJ5NmJnPZEdxi3QWXLyJ83BPMb2 r503zWwhbKowRJ1pZRq+n8hcS5K3Q/X9utGazw2EEDHHNYrS+jUdhyaxm3nSDydo+3O7 K1cpmTpKgo7CgiHbzMY27x/uapjv5o+drleiRzxhILJEfLet1M/HOPtt3ywp6McGeKNN O5UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690776420; x=1691381220; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iecctykKTsm0q82UtUMIa1inbPuKOlOwMPntbBWiA7M=; b=WxGJ2sF6qmvZ8bRGUy/WbQfwR7MK2KajxiufeXowv/obzwxWtQBMmvXD6H1mMd+7Qv eKeZevbknzUru1kIPIsIXf7YkZ/LL9LTyG4wpY/2s/pg/7WuYTNLgpB3D7j/x6qCI8mJ oyvFt4ALPtdiHDFd7/aUY9UtzGPPuuI7ppkkfrCeFZ0WAzBuBpf9wjE/Nk0gYVuM7AF1 SGr1J3J567DC0ORM7CpyxIcGreoQUIb9qPbdeRK6SAChUPHXp2luWW/BEsPU0lzV8Tqh PBoKAoNVgEQVP24DDEu2OiSNlR1m1SRt/dfU4w4Z8t6CvjJC8Ts4RsE0gomzMzeGUG9a iDpA== X-Gm-Message-State: ABy/qLZeCqQCX37rUqFFKk1gP8+wIkMZeSMOQsnGdAyPyAvlMG8lyhGF voUOl3Cn8BPDNdc4LxsAYboctFMv5WdVDw== X-Received: by 2002:a05:6a20:3d8b:b0:130:f6bc:9146 with SMTP id s11-20020a056a203d8b00b00130f6bc9146mr10223204pzi.14.1690776420484; Sun, 30 Jul 2023 21:07:00 -0700 (PDT) Received: from Laptop-X1 ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id n4-20020a637204000000b0054fe7736ac1sm7178398pgc.76.2023.07.30.21.06.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jul 2023 21:06:59 -0700 (PDT) Date: Mon, 31 Jul 2023 12:06:55 +0800 From: Hangbin Liu To: Yang Li Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, jiri@resnulli.us, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Abaci Robot Subject: Re: [PATCH net-next] team: Remove NULL check before dev_{put, hold} Message-ID: References: <20230727005741.114069-1-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230727005741.114069-1-yang.lee@linux.alibaba.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, Jul 27, 2023 at 08:57:41AM +0800, Yang Li wrote: > The call netdev_{put, hold} of dev_{put, hold} will check NULL, > so there is no need to check before using dev_{put, hold}, > remove it to silence the warning: > > ./drivers/net/team/team.c:2325:3-10: WARNING: NULL check before dev_{put, hold} functions is not needed. > > Reported-by: Abaci Robot > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5991 > Signed-off-by: Yang Li Acked-by: Hangbin Liu > --- > drivers/net/team/team.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c > index d3dc22509ea5..bc50fc3f6913 100644 > --- a/drivers/net/team/team.c > +++ b/drivers/net/team/team.c > @@ -2321,8 +2321,7 @@ static struct team *team_nl_team_get(struct genl_info *info) > ifindex = nla_get_u32(info->attrs[TEAM_ATTR_TEAM_IFINDEX]); > dev = dev_get_by_index(net, ifindex); > if (!dev || dev->netdev_ops != &team_netdev_ops) { > - if (dev) > - dev_put(dev); > + dev_put(dev); > return NULL; > } > > -- > 2.20.1.7.g153144c >