William A. Kennington III | ac69b48 | 2021-06-02 12:28:27 -0700 | [diff] [blame] | 1 | From 42ba67f9a51ef959e7fd8dac29b5398c121c6976 Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Fri, 30 Apr 2021 23:45:56 +0200 |
| 4 | Subject: [PATCH] lib/ext2fs/unix_io.c: do unlock on error |
| 5 | |
| 6 | Upstream-Status: Submitted [https://github.com/tytso/e2fsprogs/pull/68] |
| 7 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 8 | --- |
| 9 | lib/ext2fs/unix_io.c | 2 +- |
| 10 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 11 | |
| 12 | diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c |
| 13 | index 64eee342..528c2fbc 100644 |
| 14 | --- a/lib/ext2fs/unix_io.c |
| 15 | +++ b/lib/ext2fs/unix_io.c |
| 16 | @@ -398,7 +398,7 @@ static errcode_t raw_write_blk(io_channel channel, |
| 17 | mutex_lock(data, BOUNCE_MTX); |
| 18 | if (ext2fs_llseek(data->dev, location, SEEK_SET) < 0) { |
| 19 | retval = errno ? errno : EXT2_ET_LLSEEK_FAILED; |
| 20 | - goto error_out; |
| 21 | + goto error_unlock; |
| 22 | } |
| 23 | actual = write(data->dev, buf, size); |
| 24 | mutex_unlock(data, BOUNCE_MTX); |