nvme: assert that tracker's request is valid
In nvme_qpair_complete_tracker, make sure we got a valid request in the tracker that is being completed. This should never occur in practice, but safeguard against it in case of programmer error. Fixes a scan-build warning about potential NULL dereference. Change-Id: Id82af604d2a5ed5de0aeccf3affa1900f6712ebe Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
2e1b5532e1
commit
5717784633
@ -298,6 +298,9 @@ nvme_qpair_complete_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr,
|
||||
bool retry, error;
|
||||
|
||||
req = tr->req;
|
||||
|
||||
nvme_assert(req != NULL, ("tr has NULL req\n"));
|
||||
|
||||
error = nvme_completion_is_error(cpl);
|
||||
retry = error && nvme_completion_is_retry(cpl) &&
|
||||
req->retries < nvme_retry_count;
|
||||
|
Loading…
Reference in New Issue
Block a user