summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-05-20 11:11:06 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-05-20 11:11:06 +0000
commit762b7055abcb62f74c4a9d9634395d2d738da610 (patch)
treee4a1d8f8cd39b3d7e33a70ef367b636b280786d3 /sys
parent82950b477cde9a6ebb4f58a7902cbb7f3e062ede (diff)
check we allocated the cq, not the sq, after trying to allocate the cq
found by NONAKA Kimihiro while he was porting nvme to netbsd.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/nvme.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index 26271e778a8..fa021e42f6c 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
+/* $OpenBSD: nvme.c,v 1.50 2016/05/20 11:11:05 dlg Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@@ -1224,7 +1224,7 @@ nvme_q_alloc(struct nvme_softc *sc, u_int16_t id, u_int entries, u_int dstrd)
q->q_cq_dmamem = nvme_dmamem_alloc(sc,
sizeof(struct nvme_cqe) * entries);
- if (q->q_sq_dmamem == NULL)
+ if (q->q_cq_dmamem == NULL)
goto free_sq;
memset(NVME_DMA_KVA(q->q_sq_dmamem), 0, NVME_DMA_LEN(q->q_sq_dmamem));