From 1af483d3716d6b520c1b4fd984ccecee638b2886 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Fri, 1 Oct 2010 02:22:08 +0000 Subject: check if the table is NULL before accessing it Signed-off-by: Raghavendra Bhat Signed-off-by: Vijay Bellur BUG: 1757 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1757 --- xlators/performance/io-cache/src/io-cache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/performance') diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 296edf23303..7de7640de64 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -181,7 +181,7 @@ ioc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, struct iatt *stbuf, dict_t *dict, struct iatt *postparent) { ioc_inode_t *ioc_inode = NULL; - ioc_table_t *table = this->private; + ioc_table_t *table = NULL; uint8_t cache_still_valid = 0; uint64_t tmp_ioc_inode = 0; uint32_t weight = 0xffffffff; @@ -198,6 +198,11 @@ ioc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + if (!this || !this->private) + goto out; + + table = this->private; + path = local->file_loc.path; LOCK (&inode->lock); -- cgit