]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: destroy dc->writeback_write_wq if failed to create dc->writeback_thread
authorColy Li <colyli@suse.de>
Fri, 28 Jun 2019 11:59:44 +0000 (19:59 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 28 Jun 2019 13:39:16 +0000 (07:39 -0600)
commit058c06a23cbd06c4a3c2d8b30458ed7da82c97e5
tree2fd3723add980cfeb3d73fe7fc252be461301b5a
parent846da8f1a68d629a3ab53cae7a6e74663e385f2c
bcache: destroy dc->writeback_write_wq if failed to create dc->writeback_thread

Commit 475f7364e3e4 ("bcache: fix for gc and write-back race") added a
new work queue dc->writeback_write_wq, but forgot to destroy it in the
error condition when creating dc->writeback_thread failed.

This patch destroys dc->writeback_write_wq if kthread_create() returns
error pointer to dc->writeback_thread, then a memory leak is avoided.

Fixes: 475f7364e3e4 ("bcache: fix for gc and write-back race")
Signed-off-by: Coly Li <colyli@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/writeback.c