From patchwork Thu May 11 07:21:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 92410 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4176835vqo; Thu, 11 May 2023 00:27:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NH4kn1o465XYBy4vElwFLdDli7rGw3/OZXV7FWIkOnfAuvVT443qtq1YwNOuRM6QD7tij X-Received: by 2002:a17:902:ecd0:b0:1ac:76a6:a1f with SMTP id a16-20020a170902ecd000b001ac76a60a1fmr16581456plh.16.1683790046927; Thu, 11 May 2023 00:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683790046; cv=none; d=google.com; s=arc-20160816; b=BMVIiNxU3sy85xEkE6vtRebC7AAVWALVL2eUqyyqULq3nIgydopCp1OHoE7xLwLvyH qYx4Gnq2YSm1CuMsb4cPOinVdqRqakuRlPW9sfAjuyVARgkrlTfzA79lwku8a2Oy40uy fq01tPblzsZpmwdwBhMqyzZvSCUSAlSsDUXoQSTge8mrY+TornkI4tTdN3aQE+6se7uc FXT+tsHL2QQ2iUZqP7AYARxhxrmhmEU3gBkI4vD1pj1hCLxRdVwa1uGsrczSbmR985fW Cq7e3pXsG6u/IyGRO6DhBFA4GAtMaXb6Xw5WsimhGUV14fffjsTW8xT0WMzpbpMNTmxU kdJQ== 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=BxHLja6JF9L6BTMMR9JqXFHkQp/2X/SbD20iKIkqTME=; b=NdT2RWQ8WtMx25jWIPfCnKI7GP/ruY3WcvA1i3LWIPHUlbaa4E6JUrNqEntvpsc0K7 ayczcssvlZjGQPUOxBcEn4CPaZv2cxTj/PwZ9ffIjGUm3P7gJDZavvWtg2QHY3We1WT5 YwHYxQ3tkdCYkENTVmiWYTXnsy2SvGpnukZcioEKKrENOAqKZw56mp/X6O1S9owiwvFd xsKjj9iKWeAHJXLje0qedlse8oEjmdX67yVniZfC6VhqGbU4PJdPpJYEv+j4XmElUHb4 EOZBbuSaWBHu1IBw+OLIP77LL0hJ8b6cpMBLxfp6taGVLvUZAYg3rqrsgeC0MTsp1JaB lOAA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l191-20020a6391c8000000b00524ecf898a2si5807804pge.359.2023.05.11.00.27.14; Thu, 11 May 2023 00:27:26 -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 S237435AbjEKHWY (ORCPT + 99 others); Thu, 11 May 2023 03:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237404AbjEKHWD (ORCPT ); Thu, 11 May 2023 03:22:03 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63EC993F1; Thu, 11 May 2023 00:21:26 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R741e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0ViJZRTw_1683789681; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0ViJZRTw_1683789681) by smtp.aliyun-inc.com; Thu, 11 May 2023 15:21:22 +0800 From: Yang Li To: davem@davemloft.net Cc: edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH] ipvlan: Remove NULL check before dev_{put, hold} Date: Thu, 11 May 2023 15:21:19 +0800 Message-Id: <20230511072119.72536-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_MSPIKE_H2,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765581832532936871?= X-GMAIL-MSGID: =?utf-8?q?1765581832532936871?= 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/ipvlan/ipvlan_core.c:559:3-11: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4930 Signed-off-by: Yang Li Reviewed-by: Simon Horman --- drivers/net/ipvlan/ipvlan_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index ab5133eb1d51..a8977965a7f2 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -555,8 +555,7 @@ static void ipvlan_multicast_enqueue(struct ipvl_port *port, spin_lock(&port->backlog.lock); if (skb_queue_len(&port->backlog) < IPVLAN_QBACKLOG_LIMIT) { - if (skb->dev) - dev_hold(skb->dev); + dev_hold(skb->dev); __skb_queue_tail(&port->backlog, skb); spin_unlock(&port->backlog.lock); schedule_work(&port->wq);