From 7c418a74cbcdaa636dfdd6eb71c6d33de762a3b9 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 8 Jun 2017 09:54:11 -0700 Subject: [PATCH] vhost: avoid use-after-free of vhost task Change-Id: Ifd4f717ea6e12769c845e10578517da0a28dca11 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/364669 Reviewed-by: Ben Walker Tested-by: SPDK Automated Test System --- lib/vhost/task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/task.c b/lib/vhost/task.c index d25b34cc56..1a7f5433ac 100644 --- a/lib/vhost/task.c +++ b/lib/vhost/task.c @@ -67,8 +67,8 @@ spdk_vhost_task_free_cb(struct spdk_scsi_task *scsi_task) { struct spdk_vhost_task *task = container_of(scsi_task, struct spdk_vhost_task, scsi); - rte_mempool_put(g_task_pool, task); spdk_vhost_dev_task_unref((struct spdk_vhost_dev *) task->svdev); + rte_mempool_put(g_task_pool, task); } struct spdk_vhost_task *