Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8416906rwr; Thu, 11 May 2023 00:32:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bDuKYTJ3KwsxjYVxB6yWEA/R91C3iO8gCQHtsyr23slGoukpKJ0nJ9Xi0cJt7gugVu8k8 X-Received: by 2002:a05:6a20:918d:b0:ee:cc76:5023 with SMTP id v13-20020a056a20918d00b000eecc765023mr26584929pzd.22.1683790347409; Thu, 11 May 2023 00:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683790347; cv=none; d=google.com; s=arc-20160816; b=CZqPjydKOEe+QyyEGcgoKQgECIS794pYaDKTe152S6+6SjYh9AM31/FQbmArDr4qgK 772PvMD11uC/U3ptv1iZHC6IuiPGI5+xblbVVxTS8l1o313rCaRKUdyiFi/4nhoQ8Ho+ sjUaFfZyJpZ//zUgt9oi0S85zpkrHz2pdOjIfU4K3udrd3thEo6+psp5bh8dF+f65fWU fSb9EMqzOKr/0U4qQ0WVvjUFgHrefkuFpEC8dAfTFwTlLp02YwZ9vqmJIyhj90eRrvKX 14aG4BWcMGwpNJJWXub/d2Gr6cVjX35Zhw7FsHVYEruzllU9Bvjy+8DpSZwEfC4LcFM6 ELBA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j184-20020a6380c1000000b005303a36c1bbsi6209286pgd.420.2023.05.11.00.32.12; Thu, 11 May 2023 00:32:27 -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 S237631AbjEKHWY (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 Content-Transfer-Encoding: 8bit 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 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 --- 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); -- 2.20.1.7.g153144c