From a9181877e3013dcaca5b59ef7764246163c10585 Mon Sep 17 00:00:00 2001 From: Poornima Date: Sun, 26 Jan 2014 22:08:46 +0000 Subject: performance/io-cache: Fix dereferencing of freed pointer Change-Id: Ic4276c6d76c36f4eb77282dc06d2b8b212b58f08 BUG: 789278 Signed-off-by: Poornima Reviewed-on: http://review.gluster.org/6822 Reviewed-by: Raghavendra G Tested-by: Gluster Build System --- xlators/performance/io-cache/src/page.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'xlators/performance/io-cache') diff --git a/xlators/performance/io-cache/src/page.c b/xlators/performance/io-cache/src/page.c index a21b318169c..416cd5fe44e 100644 --- a/xlators/performance/io-cache/src/page.c +++ b/xlators/performance/io-cache/src/page.c @@ -136,6 +136,7 @@ int64_t ioc_page_destroy (ioc_page_t *page) { int64_t ret = 0; + struct ioc_inode *inode = NULL; if (page == NULL) { goto out; @@ -143,9 +144,10 @@ ioc_page_destroy (ioc_page_t *page) ioc_inode_lock (page->inode); { + inode = page->inode; ret = __ioc_page_destroy (page); } - ioc_inode_unlock (page->inode); + ioc_inode_unlock (inode); out: return ret; @@ -1032,6 +1034,7 @@ ioc_waitq_t * ioc_page_error (ioc_page_t *page, int32_t op_ret, int32_t op_errno) { ioc_waitq_t *waitq = NULL; + struct ioc_inode *inode = NULL; if (page == NULL) { goto out; @@ -1039,9 +1042,10 @@ ioc_page_error (ioc_page_t *page, int32_t op_ret, int32_t op_errno) ioc_inode_lock (page->inode); { + inode = page->inode; waitq = __ioc_page_error (page, op_ret, op_errno); } - ioc_inode_unlock (page->inode); + ioc_inode_unlock (inode); out: return waitq; -- cgit