Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1811520rwb; Sun, 15 Jan 2023 04:52:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXsuhH0nuuSOZB4EzW/JZrHeZOC7KgbU4ei1PRWmroagCHYvrLDf2g1YiXzveuZfo6qpSIwQ X-Received: by 2002:a17:90a:2e81:b0:228:d550:b04e with SMTP id r1-20020a17090a2e8100b00228d550b04emr19560106pjd.49.1673787135976; Sun, 15 Jan 2023 04:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673787135; cv=none; d=google.com; s=arc-20160816; b=QhazJIbqr/QMAx0KZS1KWfa9cvGB9hBu7wgdFdIHZcdlk9Th3qILEagummhhy9i4sI 96+TFTwnE+I124jwoXm/fIes+A9jcnWkd5NSm8fZ84fweUdRePXfvnsgjyJbHv/Z9Vc9 YQLnsN5tMB0NxteaV7x1CNkAavvACjWQ9kU0RViGXjCIyjXtHdIV0K9uIaGcTxWbyoJr /7FZSR+FXZOVrvdpcsbpG6ZcJJodWiVNG4HwQhW12g62XgI2Pie/lzPvU3UpcaCg51Zk ZtHoOV3CCC4SXkpSJ/zmFFILO5uVlEhW7nQ77+LQDEpPNixY5sxP8O9VPmFn2he9IRf9 ASmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hgJYh/AYIbjgIPlkc+4CNM+P0Yj7iVboDvhSp3izgmY=; b=rCpwYfp7EHaycNM7eThbOFnZNYY6MfZl53epWbd/ZEgcP/99hPRMS0YPtF79it4DuH 8trYBC0hTRlWB8YYH6AXvv+h56tCcq6EirsIjwvfFmSVIPfIe8zsWbyh+RhgUaPPFqUb vfYLrIkwDFFtOO5D2/zidtCE0LWa5VIz5ZUy0VtMEiDdlYmf4gRxH9hbn/qk08y+xnvD oufpr0p4PS4GJT0P5FZB77uiRfFmbyStdqdHijYl9GxxylnRfLD6clhV4ZnKQfc6HhWr HSJATyfrNXZpwThZMDst5jdMjWCc0MIjuE0rfDkUbAN2j+kDEtJMFrxuPckrCn9wqn5P p6hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q63pLgXy; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r73-20020a632b4c000000b0047943945625si25574108pgr.720.2023.01.15.04.52.09; Sun, 15 Jan 2023 04:52:15 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=Q63pLgXy; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230392AbjAOMJ1 (ORCPT + 52 others); Sun, 15 Jan 2023 07:09:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjAOMJY (ORCPT ); Sun, 15 Jan 2023 07:09:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9315BCDFB; Sun, 15 Jan 2023 04:09:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2211760C97; Sun, 15 Jan 2023 12:09:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0354C433D2; Sun, 15 Jan 2023 12:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673784562; bh=lUxAxMc9+2hSdJcDN+MqbxKx0/XB9tFQG3YcYX7tx8Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q63pLgXyE83CtcneiswTFzKDYQMjjcv7P3d5czAMP7hKwkeq0/rtCSOB102dP+AFI opkpp79Gi4aqYuLsoCDxufCt1vRPLtazbgJIuUqVwGFbr4IvoD4LD1Nwc27Ya8Dts5 9vPYvLo1tOGkHF/IqvqUQH4iDHTQwntmb+AjRnzf4Atvs/9JAy1xK6S2gLIMZloLlP W+c80/Y5JtTt/6weE6a73o5Biw5m2NgqGfhP6Eu+6pKkuJMWJohi/dHlzgfEdikuf0 Z/ZkIjJdCTpqQCQPbkjzGc8ZaIklDNR4jgMqwNdZDH0rV1KsE3vzBJcaQRSf2qpl9w JqtWixhKOoygA== Date: Sun, 15 Jan 2023 14:09:17 +0200 From: Leon Romanovsky To: Zhu Yanjun Cc: Jia-Ju Bai , zyjzyj2000@gmail.com, jgg@ziepe.ca, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, TOTE Robot Subject: Re: [PATCH] infiniband: sw: rxe: Add NULL checks for qp->resp.mr Message-ID: References: <20230113023527.728725-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Fri, Jan 13, 2023 at 03:53:46PM +0800, Zhu Yanjun wrote: > 在 2023/1/13 10:35, Jia-Ju Bai 写道: > > In a previous commit 3282a549cf9b, qp->resp.mr could be NULL. Moreover, > > in many functions, qp->resp.mr is checked before its dereferences. > > However, in some functions, this variable is not checked, and thus NULL > > checks should be added. > > IMO, we should analyze the code snippet one by one. > And it is not good to add "NULL check" without futher investigations. +1