Message ID | 1666338764-2-1-git-send-email-lizhijian@fujitsu.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp555097wrr; Fri, 21 Oct 2022 01:03:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48GiiHn0QisdE7Bm8rJkvJiIE62th67JDi9T5B5HtdxHSbXxlGiEybcQ2oPf5EwPoVuz4O X-Received: by 2002:a17:90b:1d03:b0:212:cd82:aa0c with SMTP id on3-20020a17090b1d0300b00212cd82aa0cmr2414613pjb.214.1666339395711; Fri, 21 Oct 2022 01:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666339395; cv=none; d=google.com; s=arc-20160816; b=jp6TNoCDdzSCHJXdJH0wxtmv3t2clwNN102gHBJ/3YaTWBZIwt/KbrRpx9ZvRGEyCX yEzjjhAtHi5HED2S+YN0KdoH0K4GE9/8vI/1FDrG2OliKOXfrdSl3xiAcHragVFIeFN+ 0yRzpawOFZsSq0YiwhBaWiyPZVFY3nZesvAEVFggG3lqOkPGEqGavv4uYW3G/L6EyIRY U75OqDG8Z3MEMJOgTUgARySS7mmCwlz3zq5ekc2ZlClzxOIFTulcmY8LxghX3qJU0r5L 7mEB+ufrw7LTOsvXidn07mTtQknMucNK06E0qBmQB1EC5C+jJRtZFyX7eQ2P8M7v51bF luhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=szLPaMCwWt2GPt2jeJIVDwTUnrQYN4R0TZFNJZtF4F0=; b=ejBLfIrzlZ8IRSTxPOAWn+66TRPlQrnhvfnVh8jt/Mh2JPBbzfpL/9zqvFAX6DGaNZ Ernwd7frhrFZbmAT/Wlyp5BInVq2I4S9BEtQA7TMqjmDIkWb/5h1nJ4yFrfPBQDZ9hsn MI/4IHE91E87PE7mbYgALe9hmRjIIMC75E6iK8PLq9aUc7LZXQbap5NSTDGC1O8Tbq2z 6lMZygDxPnuBSy/Py21kuODC+xwxlipKsukDIn8VbZYOFH4C5r2ZGXAZ/eRug80DniJ3 8y8bh4lEIWQzLDd/+MkThckpD2eRTLx/r9CakXYzikI0wS00Dqq8Xle+7TQU67FH/3zl /CNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fujitsu.com header.s=170520fj header.b=hjYtH5Hn; 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=NONE dis=NONE) header.from=fujitsu.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gc4-20020a17090b310400b00212c87edbcesi2221016pjb.76.2022.10.21.01.03.01; Fri, 21 Oct 2022 01:03:15 -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=@fujitsu.com header.s=170520fj header.b=hjYtH5Hn; 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=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbiJUHxW (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 21 Oct 2022 03:53:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbiJUHxV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 03:53:21 -0400 Received: from mail1.bemta37.messagelabs.com (mail1.bemta37.messagelabs.com [85.158.142.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8203247E22; Fri, 21 Oct 2022 00:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1666338797; i=@fujitsu.com; bh=szLPaMCwWt2GPt2jeJIVDwTUnrQYN4R0TZFNJZtF4F0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=hjYtH5HnBrGXyHODtjGkU2kFODdH4Ey1XykB++B7nkrK/WwJvQqzBhhFivYiLOST3 xzm/ARdZXZ2UPzjnvdnep7M4B/4hCmBRb00USLG608JEoEwQtZar3Uzp1H8WdvbNg0 4GhlkAREvpSRAXNj0ucb5UG7urfKRe/IgEwu5/ECi5uIqNAFacP9TcrcZPi8KabZhi ci+Rb66nMCaKr4H352uGVJb99NaK+WsQSG2veeDwdE+YoTYU4Xp9DXcC3FJYTtK1yL rCNxCXrbwT7wb7+LhRCTMXYXIhKKvPZxvJ2aRiycU0uqrmKyVhP9rvNqnOrXioiJVQ vhBr1YyZDh/UA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrIIsWRWlGSWpSXmKPExsViZ8OxWfeNf1C ywdOJahYzZ5xgtJjyaymzxeVdc9gsnh3qZbE4f6yf3YHVY+esu+wem1Z1snl83iTnsfXzbZYA lijWzLyk/IoE1ozeBe3sBZs4K55MW8bewPiZvYuRi0NIYCOjxMorz1ggnCVMEpOOT4TKHGCUm LalDSjDycEmoCFxr+UmI4gtIhAj8e/YLzCbWcBNYtOb2ewgtrCAh8SJSwfA4iwCqhJ9D48zgd i8Ao4SD04vBauREFCQmPLwPTNEXFDi5MwnLBBzJCQOvngBFOcAqlGSmNkdD1FeITFrVhsThK0 mcfXcJuYJjPyzkHTPQtK9gJFpFaN5cWpRWWqRrqGpXlJRZnpGSW5iZo5eYpVuol5qqW5eflFJ hq6hXmJ5sV5qcbFecWVuck6KXl5qySZGYEinFCdw72B8tOyP3iFGSQ4mJVFeIYWgZCG+pPyUy ozE4oz4otKc1OJDjDIcHEoSvHN9gHKCRanpqRVpmTnA+IJJS3DwKInw9noBpXmLCxJzizPTIV KnGBWlxHmX+AElBEASGaV5cG2wmL7EKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZg3H2Q8T2Z eCdz0V0CLmYAWm27xA1lckoiQkmpg8j7nYJ/9P2TKshPaOb/r4vddeLnQ5F84J/fkt2uluP6v zv6w2GSt2gmvGoPrrt92WX9PlLH6FGdiftF+rfHCK7yxnLfW9hpwT43RyniytqX0xqZmfd81Z x/MCzA7kPP3bs/FuKkyrd8a5nLUprv4fmszXVdStukZz7uOzPk73FKaCyu2ri3SyygpstnIue soa/ILx60lT+JKD4izLfU15LD8YyoXv/bFRnXDJ4mTWhqNr5xR07aukJ8xp/TGHvVPIsJbbm7 5IWfPl75dpq7wS73Ita3b31pcfP1GfkaJxf0l1/9ss5NZWbprJlfB+XxrDu3UmOeMeydZCKhZ fNlfY715m36fbfy9j2v12AXfKbEUZyQaajEXFScCAG+7r19kAwAA X-Env-Sender: lizhijian@fujitsu.com X-Msg-Ref: server-8.tower-732.messagelabs.com!1666338796!137848!1 X-Originating-IP: [62.60.8.179] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.100.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3584 invoked from network); 21 Oct 2022 07:53:16 -0000 Received: from unknown (HELO n03ukasimr04.n03.fujitsu.local) (62.60.8.179) by server-8.tower-732.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Oct 2022 07:53:16 -0000 Received: from n03ukasimr04.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr04.n03.fujitsu.local (Postfix) with ESMTP id 1A429155; Fri, 21 Oct 2022 08:53:16 +0100 (BST) Received: from R01UKEXCASM126.r01.fujitsu.local (R01UKEXCASM126 [10.183.43.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr04.n03.fujitsu.local (Postfix) with ESMTPS id 0CF9D153; Fri, 21 Oct 2022 08:53:16 +0100 (BST) Received: from 988193f0f739.localdomain (10.167.225.141) by R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Fri, 21 Oct 2022 08:53:13 +0100 From: Li Zhijian <lizhijian@fujitsu.com> To: <zyjzyj2000@gmail.com>, <jgg@ziepe.ca>, <leon@kernel.org>, <linux-rdma@vger.kernel.org> CC: <linux-kernel@vger.kernel.org>, Li Zhijian <lizhijian@fujitsu.com> Subject: [for-next PATCH v2 1/2] RDMA/rxe: Remove unnecessary mr testing Date: Fri, 21 Oct 2022 07:52:43 +0000 Message-ID: <1666338764-2-1-git-send-email-lizhijian@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.225.141] X-ClientProxiedBy: G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) To R01UKEXCASM126.r01.fujitsu.local (10.183.43.178) X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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?1747283498511768639?= X-GMAIL-MSGID: =?utf-8?q?1747283498511768639?= |
Series |
[for-next,v2,1/2] RDMA/rxe: Remove unnecessary mr testing
|
|
Commit Message
Zhijian Li (Fujitsu)
Oct. 21, 2022, 7:52 a.m. UTC
Before the testing, we already passed it to rxe_mr_copy() where mr could
be dereferenced. so this checking is not exactly correct.
I tried to figure out the details how/when mr could be NULL, but failed
at last. Add a WARN_ON(!mr) to that path to tell us more when it
happends.
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
drivers/infiniband/sw/rxe/rxe_resp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index ed5a09e86417..218c14fb07c6 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -778,6 +778,7 @@ static enum resp_states read_reply(struct rxe_qp *qp, if (res->state == rdatm_res_state_new) { if (!res->replay) { mr = qp->resp.mr; + WARN_ON(!mr); qp->resp.mr = NULL; } else { mr = rxe_recheck_mr(qp, res->read.rkey); @@ -811,8 +812,7 @@ static enum resp_states read_reply(struct rxe_qp *qp, rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt), payload, RXE_FROM_MR_OBJ); - if (mr) - rxe_put(mr); + rxe_put(mr); if (bth_pad(&ack_pkt)) { u8 *pad = payload_addr(&ack_pkt) + payload;