Shenghui Wang 95f18c9d13 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>
2019-04-24 10:56:29 -06:00
..
2019-04-15 16:48:51 -07:00
2019-03-06 09:41:12 -08:00
2019-03-16 13:05:32 -07:00
2019-03-29 03:04:47 +01:00
2019-03-06 14:18:59 -08:00
2019-03-15 14:37:46 -07:00
2019-03-10 11:54:48 -07:00
2019-04-22 09:47:36 -06:00
2019-04-22 09:47:36 -06:00
2019-03-10 10:17:23 -07:00
2019-03-14 09:00:06 -07:00
2019-04-22 09:47:36 -06:00
2019-03-09 14:57:08 -08:00
2019-03-16 12:51:50 -07:00
2019-03-06 09:41:12 -08:00
2019-03-29 15:31:16 +01:00
2019-04-10 22:45:38 -07:00
2019-03-15 14:22:59 -07:00
2019-03-11 11:22:15 -07:00
2019-04-22 09:47:36 -06:00
2019-03-10 12:29:52 -07:00