Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1570778rda; Mon, 23 Oct 2023 17:38:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFTZs6bG4YDZk5GPjDrKQlrJxhG7ezZfkuwGHfp3OQKZ+jwZX8fBufsbJPWOA8/A8pwDx4 X-Received: by 2002:a05:6870:9e96:b0:1ea:5ae0:bd81 with SMTP id pu22-20020a0568709e9600b001ea5ae0bd81mr14993090oab.4.1698107919711; Mon, 23 Oct 2023 17:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698107919; cv=none; d=google.com; s=arc-20160816; b=QV/eX3PEHITWU9t2KyghCkTBYsPzG9qvbsJ38aVBu0aRSTFJFFc6fDYCA87xlt2wC2 j7xXQW9R9dGlAbAdN6TcIQngXh2RaH2sEd23ZSTdyvSEG+4ve0e9gMulfABvGCJVIkZ2 TJYYJ7shkA3SlqGFCQh6gEPppIlxFGgXPZiT+zSFoal2Y+QgcXp7+6u7ua9Coo8AqT3e 6LS/lMYr0hNDxnX8Fbl5G7vLrLVq4tnt415V/JJGhdcD+KgQRiREwZAerSxBh43PAMXh PjE98j5ZDttur/BAm2jCheh4Ssu1sWssS591cYVct8N+eejd03BYzS6TPrwQGJJNxiB1 Hcug== 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=tlojlzKPMEGPfYB4d+dzcKfw1ZtHw9taLh5Zkg7dRpE=; fh=du8G9wPjcxiMlUhK4akWInEsKxl0SJZZDqkLmydykus=; b=UVuWw3qI21Ao9BxvHR/zy7xRgsU0tUcXnDsY9mkvQFj4HpyGOjvwvW3x8MWkepxVgG fRhj7pBWkuJEVKnjxMS76AdSUjgNKpAEwjSC4Iu64TvmpvPl5SmWcl+uMOrmnZ0l4C9w BwA6f76ppiQNJVonFm9+tSCrK/3hhlOAe2PZAyZDpKVOkTAtc1ze9ZebMJ1pmVzd/SRL u3VaGOY0QfgHByvDMkUeb5byVFgP3m+djkWMlcEmYVt7Gmjy42qTMC0a1Mf5M3HXBjKX rZgs8j6WpuqwyjH1sOtHCX07TjJVyPUk5qZxD5e6D+XVaaKz2k8HzZWMqYf9GU1iGjYG UC4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 194-20020a6301cb000000b0059cdf90b9b2si7247762pgb.685.2023.10.23.17.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 17:38:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2A1C380A9A98; Mon, 23 Oct 2023 17:38:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231439AbjJXAiY (ORCPT + 99 others); Mon, 23 Oct 2023 20:38:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229679AbjJXAiX (ORCPT ); Mon, 23 Oct 2023 20:38:23 -0400 Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86C1290; Mon, 23 Oct 2023 17:38:20 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vuo32gS_1698107896; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Vuo32gS_1698107896) by smtp.aliyun-inc.com; Tue, 24 Oct 2023 08:38:17 +0800 From: Yang Li To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] RDMA/core: Remove NULL check before dev_{put, hold} Date: Tue, 24 Oct 2023 08:38:15 +0800 Message-Id: <20231024003815.89742-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=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 23 Oct 2023 17:38:37 -0700 (PDT) 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/infiniband/core/nldev.c:375:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7047 Signed-off-by: Yang Li --- drivers/infiniband/core/nldev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c index 87b8cd657fb3..4900a0848124 100644 --- a/drivers/infiniband/core/nldev.c +++ b/drivers/infiniband/core/nldev.c @@ -371,8 +371,7 @@ static int fill_port_info(struct sk_buff *msg, } out: - if (netdev) - dev_put(netdev); + dev_put(netdev); return ret; } -- 2.20.1.7.g153144c