Skip to contentSkip to conversation

nvme: Fix memleak in nvme_dma_read_prp

PATCH Applied Ting Wang 3 participants 4 messages Jun 19, 2015 – Jun 22, 2015

lore
Share & tools
lore

Ting Wang

author
#0 lore raw

PATCH 1/1 nvme: Fix memleak in nvme_dma_read_prp

From: Lu Lina <[email protected]>

---
 hw/block/nvme.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/nvme.c +1 -0
index 4b6d5e6..c6a6a0e 100644
@@ -154,6 +154,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len,
         qemu_sglist_destroy(&qsg);
         return NVME_INVALID_FIELD | NVME_DNR;
     }
+    qemu_sglist_destroy(&qsg);
     return NVME_SUCCESS;
 }
 
Signature · 1 line
1.8.5
#1 lore raw

On Fri, Jun 19, 2015 at 02:27:34PM +0800, Ting Wang wrote:

Please CC the maintainer of this source file:

  $ scripts/get_maintainer.pl -f hw/block/nvme.c
  Keith Busch <[email protected]> (supporter:nvme)
  Kevin Wolf <[email protected]> (supporter:Block layer core)
  [email protected] (open list:nvme)
Quoted 3 lines

From: Lu Lina <[email protected]>

Your Signed-off-by is missing.

Quoted 21 lines
---
 hw/block/nvme.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/nvme.c +1 -0
index 4b6d5e6..c6a6a0e 100644
@@ -154,6 +154,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len,
         qemu_sglist_destroy(&qsg);
         return NVME_INVALID_FIELD | NVME_DNR;
     }
+    qemu_sglist_destroy(&qsg);
     return NVME_SUCCESS;
 }
 
Signature · 1 line
1.8.5
Acked-by
#2 lore raw
Quoted 3 lines · Stefan Hajnoczi
Quoted 3 lines

From: Lu Lina <[email protected]>

Thanks for the fix.

Quoted 7 lines
Quoted 7 lines
hw/block/nvme.c +1 -0
@@ -154,6 +154,7 @@ static uint16_t nvme_dma_read_prp(NvmeCtrl *n, uint8_t *ptr, uint32_t len,
         qemu_sglist_destroy(&qsg);
         return NVME_INVALID_FIELD | NVME_DNR;
     }
+    qemu_sglist_destroy(&qsg);
     return NVME_SUCCESS;
 }