From edf5b0b4b89b46a566607d159b282c57298679db Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 27 Sep 2010 08:55:55 +0000 Subject: io-threads: fix NULL dereference in 'reconfigure()' Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1715 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1715 --- xlators/performance/io-threads/src/io-threads.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'xlators/performance/io-threads/src/io-threads.c') diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 0fe034a3f..72fbd567f 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -2088,9 +2088,12 @@ int reconfigure ( xlator_t *this, dict_t *options) { iot_conf_t *conf = NULL; - int ret = 0; + int ret = -1; int thread_count; - + + conf = this->private; + if (!conf) + goto out; if (dict_get (options, "thread-count")) { thread_count = data_to_int32 (dict_get (options, @@ -2100,7 +2103,6 @@ reconfigure ( xlator_t *this, dict_t *options) gf_log ("io-threads", GF_LOG_WARNING, "Number of threads opted is less then min rest" "oring it to previous value",conf->max_count); - ret = -1; goto out; } @@ -2108,7 +2110,6 @@ reconfigure ( xlator_t *this, dict_t *options) gf_log ("io-threads", GF_LOG_WARNING, "Number of threads opted is greater than max " "restoring it to previous value",conf->max_count); - ret = -1; goto out; } @@ -2119,8 +2120,6 @@ reconfigure ( xlator_t *this, dict_t *options) out: return ret; - - } int -- cgit