From 904f3aa1e108f838439355c55b24ca3929cbac4a Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 13 Oct 2017 14:27:22 -0700 Subject: [PATCH] lvol: don't pass lvs to cb_fn after it was freed Change-Id: I6d3669bc19b51fd72af7ea27aa4d2a88dee59e58 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/382509 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris --- lib/lvol/lvol.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/lvol/lvol.c b/lib/lvol/lvol.c index d16aa5d0a..baf477c47 100644 --- a/lib/lvol/lvol.c +++ b/lib/lvol/lvol.c @@ -55,7 +55,10 @@ _spdk_super_create_close_cb(void *cb_arg, int lvolerrno) if (lvolerrno < 0) { SPDK_ERRLOG("Lvol store init failed: could not close super blob\n"); + req->cb_fn(req->cb_arg, NULL, lvolerrno); free(lvs); + free(req); + return; } req->cb_fn(req->cb_arg, lvs, lvolerrno);