linux/drivers/md/bcache
Coly Li f11ba9df8e bcache: destroy dc->writeback_write_wq if failed to create dc->writeback_thread
commit f54d801dda upstream.

Commit 9baf30972b ("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: 9baf30972b ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-26 09:14:21 +02:00
..
alloc.c bcache: check CACHE_SET_IO_DISABLE in allocator code 2019-07-26 09:14:13 +02:00
bcache.h bcache: Revert "bcache: fix high CPU occupancy during journal" 2019-07-26 09:14:21 +02:00
bset.c bcache: fix stack corruption by PRECEDING_KEY() 2019-06-19 08:18:00 +02:00
bset.h bcache: fix stack corruption by PRECEDING_KEY() 2019-06-19 08:18:00 +02:00
btree.c bcache: fix miss key refill->end in writeback 2018-11-13 11:08:16 -08:00
btree.h bcache: style fixes for lines over 80 characters 2018-08-11 15:46:41 -06:00
closure.c bcache: add missing SPDX header 2018-08-11 15:46:42 -06:00
closure.h bcache: add the missing comments for smp_mb()/smp_wmb() 2018-08-11 15:46:42 -06:00
debug.c bcache: replace printk() by pr_*() routines 2018-08-11 15:46:41 -06:00
debug.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
extents.c bcache: replace printk() by pr_*() routines 2018-08-11 15:46:41 -06:00
extents.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
io.c bcache: ignore read-ahead request failure on backing device 2019-07-26 09:14:21 +02:00
journal.c bcache: Revert "bcache: free heap cache_set->flush_btree in bch_journal_free" 2019-07-26 09:14:21 +02:00
journal.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
Kconfig for-4.19/post-20180822 2018-08-22 13:38:05 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
movinggc.c bcache: style fix to add a blank line after declarations 2018-08-11 15:46:41 -06:00
request.c bcache: use (REQ_META|REQ_PRIO) to indicate bio for metadata 2019-03-23 20:10:13 +01:00
request.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
stats.c bcache: style fix to add a blank line after declarations 2018-08-11 15:46:41 -06:00
stats.h bcache: add identifier names to arguments of function definitions 2018-08-11 15:46:41 -06:00
super.c Revert "bcache: set CACHE_SET_IO_DISABLE in bch_cached_dev_error()" 2019-07-26 09:14:20 +02:00
sysfs.c bcache: fix mistaken sysfs entry for io_error counter 2019-07-26 09:14:21 +02:00
sysfs.h bcache: improve sysfs_strtoul_clamp() 2019-04-05 22:33:09 +02:00
trace.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
util.c for-4.19/post-20180822 2018-08-22 13:38:05 -07:00
util.h bcache: Revert "bcache: fix high CPU occupancy during journal" 2019-07-26 09:14:21 +02:00
writeback.c bcache: destroy dc->writeback_write_wq if failed to create dc->writeback_thread 2019-07-26 09:14:21 +02:00
writeback.h bcache: never writeback a discard operation 2019-03-23 20:10:10 +01:00