[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230905064846.GA19701@lst.de>
Date: Tue, 5 Sep 2023 08:48:46 +0200
From: Christoph Hellwig <hch@....de>
To: Daniel Wagner <dwagner@...e.de>
Cc: 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>,
Christoph Hellwig <hch@....de>
Subject: Re: [RFC v1 1/4] nvmet-trace: avoid dereferencing pointer too early
> +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?
Powered by blists - more mailing lists