diff options
author | Zhiqiang Liu <liuzhiqiang26@huawei.com> | 2021-04-11 21:43:10 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-04-11 08:37:55 -0600 |
commit | 13e1db65d2b9263c3dfe447077981e7a32c857ae (patch) | |
tree | fc7b1b0fa985708d5663b1dda3079a6c945b4ff7 /drivers/md/bcache/btree.c | |
parent | ff917638359e2d0dc122acbb23b74be294ee3d77 (diff) | |
download | lwn-13e1db65d2b9263c3dfe447077981e7a32c857ae.tar.gz lwn-13e1db65d2b9263c3dfe447077981e7a32c857ae.zip |
bcache: reduce redundant code in bch_cached_dev_run()
In bch_cached_dev_run(), free(env[1])|free(env[2])|free(buf)
show up three times. This patch introduce out tag in
which free(env[1])|free(env[2])|free(buf) are only called
one time. If we need to call free() when errors occur,
we can set error code to ret, and then goto out tag directly.
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20210411134316.80274-2-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/btree.c')
0 files changed, 0 insertions, 0 deletions