[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e3488129-6681-55a7-3d1c-99a965a5c884@fujitsu.com>
Date: Wed, 31 Aug 2022 02:31:37 +0000
From: "yangx.jy@...itsu.com" <yangx.jy@...itsu.com>
To: "lizhijian@...itsu.com" <lizhijian@...itsu.com>,
"bvanassche@....org" <bvanassche@....org>,
"jgg@...dia.com" <jgg@...dia.com>,
"leon@...nel.org" <leon@...nel.org>
CC: "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] RDMA/srp: Set scmnd->result only when scmnd is not NULL
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;
Best Regards,
Xiao Yang
Powered by blists - more mailing lists