lfsr: ensure we don't generate an offset + buflen that exceeds the max size
[fio.git] / flow.c
diff --git a/flow.c b/flow.c
index e5c4a40462ceb5e6e94bebcf3534016ebf6091a4..2993f4e8f8c48dbdc86ad25afc0653fcef31a481 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);
@@ -92,7 +92,7 @@ void flow_exit_job(struct thread_data *td)
 
 void flow_init(void)
 {
-       flow_lock = fio_mutex_init(1);
+       flow_lock = fio_mutex_init(FIO_MUTEX_UNLOCKED);
        flow_list = smalloc(sizeof(*flow_list));
        INIT_FLIST_HEAD(flow_list);
 }