Skip to content

Commit d2ad8f0

Browse files
committed
Merge tag 'nvme-6.3-2023-02-15' of git://git.infradead.org/nvme into for-6.3/block
Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.3 - fix and cleanup freeing single sgl (Keith Busch)" * tag 'nvme-6.3-2023-02-15' of git://git.infradead.org/nvme: nvme-pci: remove iod use_sgls nvme-pci: fix freeing single sgl
2 parents a06377c + b6c0c23 commit d2ad8f0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/nvme/host/pci.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ union nvme_descriptor {
230230
struct nvme_iod {
231231
struct nvme_request req;
232232
struct nvme_command cmd;
233-
bool use_sgl;
234233
bool aborted;
235234
s8 nr_allocations; /* PRP list pool allocations. 0 means small
236235
pool in use */
@@ -556,7 +555,7 @@ static void nvme_unmap_data(struct nvme_dev *dev, struct request *req)
556555
if (iod->nr_allocations == 0)
557556
dma_pool_free(dev->prp_small_pool, iod->list[0].sg_list,
558557
iod->first_dma);
559-
else if (iod->use_sgl)
558+
else if (iod->nr_allocations == 1)
560559
dma_pool_free(dev->prp_page_pool, iod->list[0].sg_list,
561560
iod->first_dma);
562561
else
@@ -808,8 +807,7 @@ static blk_status_t nvme_map_data(struct nvme_dev *dev, struct request *req,
808807
goto out_free_sg;
809808
}
810809

811-
iod->use_sgl = nvme_pci_use_sgls(dev, req, iod->sgt.nents);
812-
if (iod->use_sgl)
810+
if (nvme_pci_use_sgls(dev, req, iod->sgt.nents))
813811
ret = nvme_pci_setup_sgls(dev, req, &cmnd->rw);
814812
else
815813
ret = nvme_pci_setup_prps(dev, req, &cmnd->rw);

0 commit comments

Comments
 (0)