[ltt-dev] [PATCH 05/10] avoid memory leak in call_rcu_data_free()

Lai Jiangshan laijs at cn.fujitsu.com
Thu Sep 15 01:39:00 EDT 2011


Signed-off-by: Lai Jiangshan <laijs at cn.fujitsu.com>
---
 urcu-call-rcu-impl.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h
index 6cb08be..1ab49bc 100644
--- a/urcu-call-rcu-impl.h
+++ b/urcu-call-rcu-impl.h
@@ -600,9 +600,10 @@ void call_rcu_data_free(struct call_rcu_data *crdp)
 		*cbs_endprev = cbs;
 		uatomic_add(&default_call_rcu_data->qlen,
 			    uatomic_read(&crdp->qlen));
-		cds_list_del(&crdp->list);
-		free(crdp);
 	}
+
+	cds_list_del(&crdp->list);
+	free(crdp);
 }
 
 /*
-- 
1.7.4.4





More information about the lttng-dev mailing list