NVMe: Mark the end of the sg list
authorMatthew Wilcox <matthew.r.wilcox@intel.com>
Fri, 6 Jan 2012 20:49:25 +0000 (13:49 -0700)
committerMatthew Wilcox <matthew.r.wilcox@intel.com>
Tue, 10 Jan 2012 19:54:14 +0000 (14:54 -0500)
For user I/O and admin commands, we were forgetting to mark the end of
the SG list.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
drivers/block/nvme.c

index 3f8cae9..71fc903 100644 (file)
@@ -1045,6 +1045,7 @@ static struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write,
                length -= (PAGE_SIZE - offset);
                offset = 0;
        }
+       sg_mark_end(&sg[i - 1]);
 
        err = -ENOMEM;
        nents = dma_map_sg(&dev->pci_dev->dev, sg, count,