mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-19 10:11:56 -05:00
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 <kbusch@kernel.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
528589947c
commit
4e6e151cf9
@@ -935,7 +935,7 @@ static blk_status_t nvme_pci_setup_data_sgl(struct request *req,
|
||||
|
||||
nvme_pci_sgl_set_seg(&iod->cmd.common.dptr.sgl, sgl_dma, mapped);
|
||||
if (unlikely(iter->status))
|
||||
nvme_free_sgls(req);
|
||||
nvme_unmap_data(req);
|
||||
return iter->status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user