Skip to content
Commit 13e1db65 authored by Zhiqiang Liu's avatar Zhiqiang Liu Committed by Jens Axboe
Browse files

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: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
Signed-off-by: default avatarColy Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20210411134316.80274-2-colyli@suse.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ff917638
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment