From: Li Zhijian <lizhijian@fujitsu.com>
To: "Yang, Xiao/杨 晓" <yangx.jy@fujitsu.com>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"jgg@nvidia.com" <jgg@nvidia.com>,
"leon@kernel.org" <leon@kernel.org>
Cc: "linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/srp: Set scmnd->result only when scmnd is not NULL
Date: Wed, 31 Aug 2022 11:02:35 +0800 [thread overview]
Message-ID: <f05347d1-854c-4aa5-c937-71e7b36f234f@fujitsu.com> (raw)
In-Reply-To: <e3488129-6681-55a7-3d1c-99a965a5c884@fujitsu.com>
On 31/08/2022 10:31, Yang, Xiao/杨 晓 wrote:
> On 2022/8/31 9:59, Li Zhijian wrote:
>> What i can see is that we have other places to de-reference scmnd and
>>
>> scmnd = srp_claim_req(ch, req, NULL, scmnd) is possible to return a NULL
>> to scmnd
> Hi,
>
> Thanks for your review.
>
> Yes, it seems better to just check scmnd before setting scmnd->result,
> like this:
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c
> b/drivers/infiniband/ulp/srp/ib_srp.c
> index 7720ea270ed8..99f5e7f852b3 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -1972,7 +1972,9 @@ static void srp_process_rsp(struct srp_rdma_ch
> *ch, struct srp_rsp *rsp)
>
> return;
> }
> - scmnd->result = rsp->status;
> +
> + if (scmnd)
> + scmnd->result = rsp->status;
Not really, i think you may need to return directly if !scmnd
>
> Best Regards,
> Xiao Yang
next prev parent reply other threads:[~2022-08-31 3:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 1:47 yangx.jy
2022-08-31 1:59 ` Li Zhijian
2022-08-31 2:31 ` yangx.jy
2022-08-31 3:02 ` Li Zhijian [this message]
2022-08-31 2:47 ` Bart Van Assche
2022-08-31 3:16 ` yangx.jy
2022-08-31 4:04 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f05347d1-854c-4aa5-c937-71e7b36f234f@fujitsu.com \
--to=lizhijian@fujitsu.com \
--cc=bvanassche@acm.org \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=yangx.jy@fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®