From e55a3c945062341cea1e359fa5f7fe68ce21a805 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 20 Oct 2017 15:30:56 -0700 Subject: [PATCH] lvol: fix lvol_req NULL check in spdk_lvol_destroy() This was looking at req, but req had already been allocated and checked for NULl previously; this line was intended to be checking lvol_req. Change-Id: I8603d35fb4582c109e9d02f4964bbd6d21735324 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/383312 Tested-by: SPDK Automated Test System Reviewed-by: Changpeng Liu Reviewed-by: Tomasz Zawadzki --- lib/lvol/lvol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lvol/lvol.c b/lib/lvol/lvol.c index dd4f42417..929f9c4cf 100644 --- a/lib/lvol/lvol.c +++ b/lib/lvol/lvol.c @@ -648,7 +648,7 @@ spdk_lvol_destroy(struct spdk_lvol *lvol, spdk_lvol_op_complete cb_fn, void *cb_ } lvol_req = calloc(1, sizeof(*lvol_req)); - if (!req) { + if (!lvol_req) { SPDK_ERRLOG("Cannot alloc memory for lvol request pointer\n"); cb_fn(cb_arg, -ENOMEM); free(req);