flow: Fixing uninitialized variable
authorDaniel Ehrenberg <dehrenberg@google.com>
Wed, 22 Feb 2012 10:48:19 +0000 (11:48 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 22 Feb 2012 10:48:19 +0000 (11:48 +0100)
In the flow initialization code path, there was an uninitialized
variable that led to memory corruption in certain cases. This
patch should initialize the variable properly.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
flow.c

diff --git a/flow.c b/flow.c
index e5c4a40462ceb5e6e94bebcf3534016ebf6091a4..bf5eeec59c0acf2e06d0038ff438dab459d3b2ee 100644 (file)
--- a/flow.c
+++ b/flow.c
@@ -36,7 +36,7 @@ int flow_threshold_exceeded(struct thread_data *td)
 
 static struct fio_flow *flow_get(unsigned int id)
 {
-       struct fio_flow *flow;
+       struct fio_flow *flow = NULL;
        struct flist_head *n;
 
        fio_mutex_down(flow_lock);