From 5925d8a2512b8d4452b0b0efbafd9c7536ed3a51 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 24 Apr 2013 18:05:13 +0530 Subject: performance/io-cache: Avoid double mem_put in ioc_readv On readv error io-cache frame->local is not set to NULL so the local is mem_put in STACK_DESTROY as well. This patch sets frame->local to NULL in all cases. BUG: 955751 Change-Id: I4a7340189efe02473452986b5870b02fcfa9038e Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4886 Reviewed-by: Raghavendra G Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/performance/io-cache/src/page.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index 54c6f9b50..b2e20ba65 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -824,7 +824,6 @@ ioc_frame_unwind (call_frame_t *frame) } // ioc_local_lock (local); - frame->local = NULL; iobref = iobref_new (); if (iobref == NULL) { op_ret = -1; @@ -875,6 +874,7 @@ unwind: // ioc_local_unlock (local); + frame->local = NULL; STACK_UNWIND_STRICT (readv, frame, op_ret, op_errno, vector, count, &stbuf, iobref, NULL); @@ -888,7 +888,8 @@ unwind: } pthread_mutex_destroy (&local->local_lock); - mem_put (local); + if (local) + mem_put (local); return; } -- cgit