aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Meloun <mmel@FreeBSD.org>2020-12-14 10:16:59 +0000
committerMichal Meloun <mmel@FreeBSD.org>2020-12-14 10:16:59 +0000
commit14271268904663f9a0083745032dca88962fe622 (patch)
tree8325389795d94d1737b3feb312d9edae6fecd57e
parentdcdeab25db7ca1526c4be4e9bd8cff3d6934940f (diff)
downloadsrc-14271268904663f9a0083745032dca88962fe622.tar.gz
src-14271268904663f9a0083745032dca88962fe622.zip
MFC r367955:
Ensure that the buffer is in nvme_single_map() mapped to single segment. Not a functional change.
Notes
Notes: svn path=/stable/12/; revision=368630
-rw-r--r--sys/dev/nvme/nvme_private.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h
index 85c1e857a1c7..2e2c383f455f 100644
--- a/sys/dev/nvme/nvme_private.h
+++ b/sys/dev/nvme/nvme_private.h
@@ -477,6 +477,7 @@ nvme_single_map(void *arg, bus_dma_segment_t *seg, int nseg, int error)
{
uint64_t *bus_addr = (uint64_t *)arg;
+ KASSERT(nseg == 1, ("number of segments (%d) is not 1", nseg));
if (error != 0)
printf("nvme_single_map err %d\n", error);
*bus_addr = seg[0].ds_addr;