]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: fix wrong usage use-after-freed on keylist in out_nocoalesce branch of btree_...
authorShenghui Wang <shhuiw@foxmail.com>
Wed, 24 Apr 2019 16:48:42 +0000 (00:48 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Apr 2019 16:56:29 +0000 (10:56 -0600)
commitb65db44b67aefa70c2b9b3a87e5193cb08ab1d7b
tree3d8968274c543f74610194f4974644d276d5d1c2
parent788812f88e2d3f5ff452c20a028e04fc0ae36c45
bcache: fix wrong usage use-after-freed on keylist in out_nocoalesce branch of btree_gc_coalesce

Elements of keylist should be accessed before the list is freed.
Move bch_keylist_free() calling after the while loop to avoid wrong
content accessed.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/btree.c