NVMe: Zero the command before we send it
Make sure there's no left-over bits set from previous commands that used
this slot.
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 1e57737..25ca7af 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -322,6 +322,7 @@
spin_lock_irqsave(&nvmeq->q_lock, flags);
cmnd = &nvmeq->sq_cmds[nvmeq->sq_tail];
+ memset(cmnd, 0, sizeof(*cmnd));
if (bio_data_dir(bio)) {
cmnd->rw.opcode = nvme_cmd_write;
dma_dir = DMA_TO_DEVICE;