[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230905083308.GA20920@lst.de>
Date: Tue, 5 Sep 2023 10:33:08 +0200
From: Christoph Hellwig <hch@....de>
To: Daniel Wagner <dwagner@...e.de>
Cc: Christoph Hellwig <hch@....de>, linux-nvme@...ts.infradead.org,
linux-kernel@...r.kernel.org, Hannes Reinecke <hare@...e.de>,
Sagi Grimberg <sagi@...mberg.me>,
Jason Gunthorpe <jgg@...pe.ca>,
James Smart <james.smart@...adcom.com>,
Chaitanya Kulkarni <kch@...dia.com>
Subject: Re: [RFC v1 1/4] nvmet-trace: avoid dereferencing pointer too early
On Tue, Sep 05, 2023 at 10:24:51AM +0200, Daniel Wagner wrote:
> On Tue, Sep 05, 2023 at 08:48:46AM +0200, Christoph Hellwig wrote:
> > > +static inline u16 nvmet_req_to_ctrl_id(struct nvmet_req *req)
> > > {
> > > - return req->sq->ctrl;
> > > + if (!req->sq || !req->sq->ctrl)
> > > + return 0;
> > > + return req->sq->ctrl->cntlid;
> >
> > Can you add a comment here why we have this check?
>
> /*
> * The queue and controller pointer are not valid until an
> * association has been established.
> */
sounds good.
Powered by blists - more mailing lists