NVMe: Zero the command before we send it
authorMatthew Wilcox <matthew.r.wilcox@intel.com>
Wed, 26 Jan 2011 15:08:25 +0000 (10:08 -0500)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Fri, 4 Nov 2011 19:52:52 +0000 (15:52 -0400)
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>
drivers/block/nvme.c

index 1e57737b17606f0acdd0e6f65c7c1b6a086518c2..25ca7af964699ebb5fe0bb3e5be72b9985883a21 100644 (file)
@@ -322,6 +322,7 @@ static int nvme_submit_bio_queue(struct nvme_queue *nvmeq, struct nvme_ns *ns,
        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;