Whamcloud - gitweb
libext2fs: fix missing mutex unlock in an error path of the Unix I/O manager
authorAlexander Kanavin <alex.kanavin@gmail.com>
Fri, 30 Apr 2021 21:45:56 +0000 (23:45 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 6 Jun 2021 15:18:35 +0000 (11:18 -0400)
Originally from https://github.com/tytso/e2fsprogs/pull/68

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/unix_io.c

index 64eee34..528c2fb 100644 (file)
@@ -398,7 +398,7 @@ static errcode_t raw_write_blk(io_channel channel,
                mutex_lock(data, BOUNCE_MTX);
                if (ext2fs_llseek(data->dev, location, SEEK_SET) < 0) {
                        retval = errno ? errno : EXT2_ET_LLSEEK_FAILED;
-                       goto error_out;
+                       goto error_unlock;
                }
                actual = write(data->dev, buf, size);
                mutex_unlock(data, BOUNCE_MTX);