diff options
author | Paul Winder <paul@winders.demon.co.uk> | 2020-01-20 07:33:34 +0000 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2020-01-21 10:27:50 -0500 |
commit | 709d065fa472580d0fd685caa2fe31c61c2fa25c (patch) | |
tree | 186659a43572781a823512ff13c5ac54e6de12b0 /usr/src | |
parent | dbce3eaafc7c3dceff97b7ab4de9308eb77f5795 (diff) | |
download | illumos-joyent-709d065fa472580d0fd685caa2fe31c61c2fa25c.tar.gz |
12209 nvme driver will iterate beyond the end of the DMA cookie chain
Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/io/nvme/nvme.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/src/uts/common/io/nvme/nvme.c b/usr/src/uts/common/io/nvme/nvme.c index 9fd95a1137..ae7f88c217 100644 --- a/usr/src/uts/common/io/nvme/nvme.c +++ b/usr/src/uts/common/io/nvme/nvme.c @@ -15,6 +15,7 @@ * Copyright (c) 2016 The MathWorks, Inc. All rights reserved. * Copyright 2018 Joyent, Inc. * Copyright 2019 Western Digital Corporation. + * Copyright 2020 Racktop Systems. */ /* @@ -3629,12 +3630,12 @@ nvme_fill_prp(nvme_cmd_t *cmd, bd_xfer_t *xfer) return (DDI_FAILURE); cmd->nc_sqe.sqe_dptr.d_prp[0] = xfer->x_dmac.dmac_laddress; - ddi_dma_nextcookie(xfer->x_dmah, &xfer->x_dmac); if (xfer->x_ndmac == 1) { cmd->nc_sqe.sqe_dptr.d_prp[1] = 0; return (DDI_SUCCESS); } else if (xfer->x_ndmac == 2) { + ddi_dma_nextcookie(xfer->x_dmah, &xfer->x_dmac); cmd->nc_sqe.sqe_dptr.d_prp[1] = xfer->x_dmac.dmac_laddress; return (DDI_SUCCESS); } @@ -3661,8 +3662,8 @@ nvme_fill_prp(nvme_cmd_t *cmd, bd_xfer_t *xfer) for (prp = (uint64_t *)cmd->nc_dma->nd_memp; xfer->x_ndmac > 0; prp++, xfer->x_ndmac--) { - *prp = xfer->x_dmac.dmac_laddress; ddi_dma_nextcookie(xfer->x_dmah, &xfer->x_dmac); + *prp = xfer->x_dmac.dmac_laddress; } (void) ddi_dma_sync(cmd->nc_dma->nd_dmah, 0, cmd->nc_dma->nd_len, |