From a996b228d21c5b750c2a2c449b514e1c6335cc33 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 14 Aug 2017 15:14:19 -0700 Subject: [PATCH] blob_hello: remove unnecessary cleanup NULL checks hello_context is never NULL when hello_cleanup() is called, and spdk_dma_free() does nothing if the parameter is NULL. Change-Id: I7004d70a17e5dc237206b95c26df9b100952df65 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/374205 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris --- examples/blob/hello_world/hello_blob.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/blob/hello_world/hello_blob.c b/examples/blob/hello_world/hello_blob.c index ee3944f42..3876d114c 100644 --- a/examples/blob/hello_world/hello_blob.c +++ b/examples/blob/hello_world/hello_blob.c @@ -61,15 +61,9 @@ struct hello_context_t { static void hello_cleanup(struct hello_context_t *hello_context) { - if (hello_context->read_buff) { - spdk_dma_free(hello_context->read_buff); - } - if (hello_context->write_buff) { - spdk_dma_free(hello_context->write_buff); - } - if (hello_context) { - free(hello_context); - } + spdk_dma_free(hello_context->read_buff); + spdk_dma_free(hello_context->write_buff); + free(hello_context); } /*