summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/io-cache.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-10-01 02:22:08 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-01 03:41:17 -0700
commit1af483d3716d6b520c1b4fd984ccecee638b2886 (patch)
tree398c77d483380c0776c7f401fcf3630d48a89f06 /xlators/performance/io-cache/src/io-cache.c
parentf5afcc47f9f00472d6c2b3f48127e02332cd457a (diff)
check if the table is NULL before accessing it
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1757 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1757
Diffstat (limited to 'xlators/performance/io-cache/src/io-cache.c')
-rw-r--r--xlators/performance/io-cache/src/io-cache.c7
1 files changed, 6 insertions, 1 deletions
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);