Message ID | 20230614014328.14007-1-yang.lee@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp941753vqr; Tue, 13 Jun 2023 18:56:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7fRksNuizTXNxVNttIeZ+sqlftG7aqeh9mqNNNxIvxYb4AM+wpEnPFoAFem0xtsxmhkBSr X-Received: by 2002:a17:906:4796:b0:973:fd02:a41f with SMTP id cw22-20020a170906479600b00973fd02a41fmr16295968ejc.40.1686707772687; Tue, 13 Jun 2023 18:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686707772; cv=none; d=google.com; s=arc-20160816; b=iGEHAzP5XRnzTYRueb97+riU7u1PSyBOfAwEQCaUfLipkB7y64b/lMrAnbGhALwr1B q31RZUQ+r4ZIT4SGzpe+8Scm4tn5nqHuv4vPQIuOwULHTQ690tOpEbso4sujYh6Fw71O 4/os1IjtDpvSlgduSfLRZfvpO15waUpmke4gPDSkMyw+ildKZMlZNd5OOZVC6ALYjiYa hOEZ7fcYJ10UbOguWJDbd58WZLPfrgY7agb3kKqQqohpQ2Wud0ZT8vj7ARC+Mu3aJq3V pgatjP1BudS2sVW389b+z7U/Q90mE2avoLodpIye0XOb5mzoh40puZ6GUt1fw8vbdP6c GX5Q== 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=1P5zOUcGG66sJmv5COG75LIazMNU+z1YbraeuYeoiR4=; b=WTXH7d10vHwnOeLnLu5VgcxMgbJ2IVr3LY9KvvGaoMLUKv9jUeJTS2YSPo/137Mjqo dq+g/7S5iFvu+uytwNu1xgvtEMRMfPGVgV5HEpJZntzz65YwHltIA8Cl+27MLEYrm5GA sd2rOwXTmTjOfzXqKUVczoq9Tq5+D5qT1V4BybCkEHfUl0mBD0mzvX3aFtUWxcDbLrK1 mxmpr4GOvL4rn2/qoQraoviOVn5IRMiOQux/Q7a1XRTiiwDI/Ovwls7TeakIACqr/sig kvOcUq/QUzZgq5nVwCvv9CIvr9FCB5ss/KQ7REMtrLjK1OFszXVFAyrAcIG7ns30XMYS p5Yw== 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 l2-20020a1709060e0200b009746371719esi7525974eji.571.2023.06.13.18.55.47; Tue, 13 Jun 2023 18:56:12 -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 S234588AbjFNBng (ORCPT <rfc822;jesperjuhl76@gmail.com> + 99 others); Tue, 13 Jun 2023 21:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbjFNBne (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 13 Jun 2023 21:43:34 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91ACD10CB; Tue, 13 Jun 2023 18:43:33 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Vl4HgDF_1686707010; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Vl4HgDF_1686707010) by smtp.aliyun-inc.com; Wed, 14 Jun 2023 09:43:30 +0800 From: Yang Li <yang.lee@linux.alibaba.com> To: leon@kernel.org Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH -next] RDMA/cma: Remove NULL check before dev_{put, hold} Date: Wed, 14 Jun 2023 09:43:28 +0800 Message-Id: <20230614014328.14007-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_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768641289573791619?= X-GMAIL-MSGID: =?utf-8?q?1768641289573791619?= |
Series |
[-next] RDMA/cma: Remove NULL check before dev_{put, hold}
|
|
Commit Message
Yang Li
June 14, 2023, 1:43 a.m. UTC
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/cma.c:4812:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5521
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/infiniband/core/cma.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Wed, Jun 14, 2023 at 09:43:28AM +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/infiniband/core/cma.c:4812:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed. > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5521 > Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> > --- > drivers/infiniband/core/cma.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Applied to for-next, thanks Jason
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 11643ef7002d..15940bff053c 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -4808,8 +4808,7 @@ static void cma_make_mc_event(int status, struct rdma_id_private *id_priv, event->param.ud.qkey = id_priv->qkey; out: - if (ndev) - dev_put(ndev); + dev_put(ndev); } static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)