Skip to content

Commit 4e6e151

Browse files
keithbuschChristoph Hellwig
authored andcommitted
nvme-pci: fix leak on sgl setup error
We need to free the descriptor that was allocated. We also don't necessarily need to unmap each sgl entry, which was previously being attempted unconditionally. Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 5285899 commit 4e6e151

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ static blk_status_t nvme_pci_setup_data_sgl(struct request *req,
935935

936936
nvme_pci_sgl_set_seg(&iod->cmd.common.dptr.sgl, sgl_dma, mapped);
937937
if (unlikely(iter->status))
938-
nvme_free_sgls(req);
938+
nvme_unmap_data(req);
939939
return iter->status;
940940
}
941941

0 commit comments

Comments
 (0)