Skip to content

Commit

Permalink
io-wq: fix double put of 'wq' in error path
Browse files Browse the repository at this point in the history
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: 4fb6ac3 ("io-wq: improve manager/worker handling over exec")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Mar 4, 2021
1 parent d364d9e commit 470ec4e
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/io-wq.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ static int io_wq_fork_manager(struct io_wq *wq)
return 0;
}

io_wq_put(wq);
return ret;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 470ec4e

Please sign in to comment.