aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/nvme.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2011-01-26 10:08:25 -0500
committerMatthew Wilcox <matthew.r.wilcox@intel.com>2011-11-04 15:52:52 -0400
commitb8deb62cf271fa9381edc8cf52bcae2f0225c55a (patch)
tree3ece114bd1cdaaeed51ae55b81185dfbd26073bd /drivers/block/nvme.c
parentff22b54fda2078fc3cd1bcdcb7a5ce5d08fd6591 (diff)
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>
Diffstat (limited to 'drivers/block/nvme.c')
-rw-r--r--drivers/block/nvme.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 1e57737b1760..25ca7af96469 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -322,6 +322,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
322 spin_lock_irqsave(&nvmeq->q_lock, flags); 322 spin_lock_irqsave(&nvmeq->q_lock, flags);
323 cmnd = &nvmeq->sq_cmds[nvmeq->sq_tail]; 323 cmnd = &nvmeq->sq_cmds[nvmeq->sq_tail];
324 324
325 memset(cmnd, 0, sizeof(*cmnd));
325 if (bio_data_dir(bio)) { 326 if (bio_data_dir(bio)) {
326 cmnd->rw.opcode = nvme_cmd_write; 327 cmnd->rw.opcode = nvme_cmd_write;
327 dma_dir = DMA_TO_DEVICE; 328 dma_dir = DMA_TO_DEVICE;