io-wq: fix double put of 'wq' in error path
authorJens Axboe <axboe@kernel.dk>
Fri, 26 Feb 2021 17:20:34 +0000 (10:20 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Mar 2021 13:34:00 +0000 (06:34 -0700)
We are already freeing the wq struct in both spots, so don't put it and
get it freed twice.

Reported-by: syzbot+7bf785eedca35ca05501@syzkaller.appspotmail.com
Fixes: 4fb6ac326204 ("io-wq: improve manager/worker handling over exec")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c

index 7a1d51c..f0b7e9f 100644 (file)
@@ -826,7 +826,6 @@ static int io_wq_fork_manager(struct io_wq *wq)
                return 0;
        }
 
-       io_wq_put(wq);
        return ret;
 }
 
@@ -1078,7 +1077,6 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
        if (!ret)
                return wq;
 
-       io_wq_put(wq);
        io_wq_put_hash(data->hash);
 err:
        cpuhp_state_remove_instance_nocalls(io_wq_online, &wq->cpuhp_node);