[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] tcg: Jump after always false condition
From: |
Samuel Tardieu |
Subject: |
[PATCH 2/2] tcg: Jump after always false condition |
Date: |
Fri, 15 Dec 2023 00:30:55 +0100 |
`buf_rw` is always `NULL` when jumping to the `fail` label. Move the
label `down` after the `if (buf_rw) { ... }` statement.
Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
tcg/region.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/region.c b/tcg/region.c
index 6d657e8c33..691a726eae 100644
--- a/tcg/region.c
+++ b/tcg/region.c
@@ -596,10 +596,10 @@ static int alloc_code_gen_buffer_splitwx_memfd(size_t
size, Error **errp)
fail_rx:
error_setg_errno(errp, errno, "failed to map shared memory for execute");
- fail:
if (buf_rw) {
munmap(buf_rw, size);
}
+ fail:
if (fd >= 0) {
close(fd);
}
--
2.42.0