From: ryancaicse <73822648+ryancaicse@users.noreply.github.com> Date: Mon, 1 Nov 2021 05:42:56 +0000 (+0800) Subject: libext2fs: fix missing unlocks in the error path in unix_set_blksize() X-Git-Tag: v1.46.5~15 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=ece580372624113bf0ce9e291952801c2bb1884f;p=tools%2Fe2fsprogs.git libext2fs: fix missing unlocks in the error path in unix_set_blksize() https://github.com/tytso/e2fsprogs/pull/83 Signed-off-by: Ryan Cai Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index d251c20..50ac737 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -957,8 +957,11 @@ static errcode_t unix_set_blksize(io_channel channel, int blksize) mutex_lock(data, CACHE_MTX); mutex_lock(data, BOUNCE_MTX); #ifndef NO_IO_CACHE - if ((retval = flush_cached_blocks(channel, data, FLUSH_NOLOCK))) + if ((retval = flush_cached_blocks(channel, data, FLUSH_NOLOCK))){ + mutex_unlock(data, BOUNCE_MTX); + mutex_unlock(data, CACHE_MTX); return retval; + } #endif channel->block_size = blksize;