diff options
author | Shenghui Wang <shhuiw@foxmail.com> | 2019-04-24 18:48:43 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-24 18:56:29 +0200 |
commit | 95f18c9d1310730d075499a75aaf13bcd60405a7 (patch) | |
tree | ed68f08953dc63694dc0e60ab0bbbe5bfe0bf412 /drivers/block/mtip32xx/mtip32xx.h | |
parent | bcache: fix wrong usage use-after-freed on keylist in out_nocoalesce branch o... (diff) | |
download | linux-95f18c9d1310730d075499a75aaf13bcd60405a7.tar.xz linux-95f18c9d1310730d075499a75aaf13bcd60405a7.zip |
bcache: avoid potential memleak of list of journal_replay(s) in the CACHE_SYNC branch of run_cache_set
In the CACHE_SYNC branch of run_cache_set(), LIST_HEAD(journal) is used
to collect journal_replay(s) and filled by bch_journal_read().
If all goes well, bch_journal_replay() will release the list of
jounal_replay(s) at the end of the branch.
If something goes wrong, code flow will jump to the label "err:" and leave
the list unreleased.
This patch will release the list of journal_replay(s) in the case of
error detected.
v1 -> v2:
* Move the release code to the location after label 'err:' to
simply the change.
Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/mtip32xx/mtip32xx.h')
0 files changed, 0 insertions, 0 deletions