Message ID | 20231214233055.2505387-2-sam@rfc1149.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Remove unreachable code and move label after unreachable condition | expand |
On Thu, 14 Dec 2023 at 23:32, Samuel Tardieu <sam@rfc1149.net> wrote: > > The `fail_rx`/`fail` block is only entered while `buf_rx` is equal to > its initial value `MAP_FAILED`. The `munmap(buf_rx, size);` was never > executed. > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2030 > Signed-off-by: Samuel Tardieu <sam@rfc1149.net> > --- Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/tcg/region.c b/tcg/region.c index 86692455c0..6d657e8c33 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -597,9 +597,6 @@ 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_rx != MAP_FAILED) { - munmap(buf_rx, size); - } if (buf_rw) { munmap(buf_rw, size); }
The `fail_rx`/`fail` block is only entered while `buf_rx` is equal to its initial value `MAP_FAILED`. The `munmap(buf_rx, size);` was never executed. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2030 Signed-off-by: Samuel Tardieu <sam@rfc1149.net> --- tcg/region.c | 3 --- 1 file changed, 3 deletions(-)