All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit
@ 2021-08-13  3:07 Taylor Simpson
  2021-08-13  3:07 ` [PULL 1/1] Hexagon (disas/hexagon.c) fix memory leak for early exit cases Taylor Simpson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Taylor Simpson @ 2021-08-13  3:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, tsimpson, richard.henderson, f4bug

The following changes since commit 703e8cd6189cf699c8d5c094bc68b5f3afa6ad71:

  Update version for v6.1.0-rc3 release (2021-08-10 19:08:09 +0100)

are available in the git repository at:

  https://github.com/quic/qemu tags/pull-hex-20210812

for you to fetch changes up to a7686d5d8528469b596e98eff098a5d3f8328fb3:

  Hexagon (disas/hexagon.c) fix memory leak for early exit cases (2021-08-12 09:06:05 -0500)

----------------------------------------------------------------

Don't allocate the string until error conditions have been checked

Fixes: a00cfed0e ("Hexagon (disas) disassembler")
Eliminate Coverity CID 1460121 (Resource leak)

----------------------------------------------------------------
Taylor Simpson (1):
      Hexagon (disas/hexagon.c) fix memory leak for early exit cases

 disas/hexagon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PULL 1/1] Hexagon (disas/hexagon.c) fix memory leak for early exit cases
  2021-08-13  3:07 [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Taylor Simpson
@ 2021-08-13  3:07 ` Taylor Simpson
  2021-08-13  9:21 ` [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Peter Maydell
  2021-08-15 12:15 ` Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Taylor Simpson @ 2021-08-13  3:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, tsimpson, richard.henderson, f4bug

Don't allocate the string until error conditions have been checked

Fixes: a00cfed0e ("Hexagon (disas) disassembler")
Eliminate Coverity CID 1460121 (Resource leak)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daud? <f4bug@amsat.org>
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 disas/hexagon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/disas/hexagon.c b/disas/hexagon.c
index 3c24e2a..c1a4ffc 100644
--- a/disas/hexagon.c
+++ b/disas/hexagon.c
@@ -33,7 +33,7 @@ int print_insn_hexagon(bfd_vma memaddr, struct disassemble_info *info)
 {
     uint32_t words[PACKET_WORDS_MAX];
     bool found_end = false;
-    GString *buf = g_string_sized_new(PACKET_BUFFER_LEN);
+    GString *buf;
     int i, len;
 
     for (i = 0; i < PACKET_WORDS_MAX && !found_end; i++) {
@@ -57,6 +57,7 @@ int print_insn_hexagon(bfd_vma memaddr, struct disassemble_info *info)
         return PACKET_WORDS_MAX * sizeof(uint32_t);
     }
 
+    buf = g_string_sized_new(PACKET_BUFFER_LEN);
     len = disassemble_hexagon(words, i, memaddr, buf);
     (*info->fprintf_func)(info->stream, "%s", buf->str);
     g_string_free(buf, true);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit
  2021-08-13  3:07 [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Taylor Simpson
  2021-08-13  3:07 ` [PULL 1/1] Hexagon (disas/hexagon.c) fix memory leak for early exit cases Taylor Simpson
@ 2021-08-13  9:21 ` Peter Maydell
  2021-08-13 14:57   ` Taylor Simpson
  2021-08-15 12:15 ` Peter Maydell
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2021-08-13  9:21 UTC (permalink / raw)
  To: Taylor Simpson
  Cc: Richard Henderson, QEMU Developers, Philippe Mathieu-Daudé

On Fri, 13 Aug 2021 at 04:07, Taylor Simpson <tsimpson@quicinc.com> wrote:
>
> The following changes since commit 703e8cd6189cf699c8d5c094bc68b5f3afa6ad71:
>
>   Update version for v6.1.0-rc3 release (2021-08-10 19:08:09 +0100)
>
> are available in the git repository at:
>
>   https://github.com/quic/qemu tags/pull-hex-20210812
>
> for you to fetch changes up to a7686d5d8528469b596e98eff098a5d3f8328fb3:
>
>   Hexagon (disas/hexagon.c) fix memory leak for early exit cases (2021-08-12 09:06:05 -0500)
>
> ----------------------------------------------------------------
>
> Don't allocate the string until error conditions have been checked
>
> Fixes: a00cfed0e ("Hexagon (disas) disassembler")
> Eliminate Coverity CID 1460121 (Resource leak)


I'll put this on my list to apply if we have an rc4, but I don't
think this bug is major enough to justify an rc4 if nothing
else means we need one.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit
  2021-08-13  9:21 ` [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Peter Maydell
@ 2021-08-13 14:57   ` Taylor Simpson
  0 siblings, 0 replies; 5+ messages in thread
From: Taylor Simpson @ 2021-08-13 14:57 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Richard Henderson, QEMU Developers, Philippe Mathieu-Daudé


> -----Original Message-----
> From: Peter Maydell <peter.maydell@linaro.org>
> Sent: Friday, August 13, 2021 3:21 AM
> To: Taylor Simpson <tsimpson@quicinc.com>
> Cc: QEMU Developers <qemu-devel@nongnu.org>; Richard Henderson
> <richard.henderson@linaro.org>; Philippe Mathieu-Daudé
> <f4bug@amsat.org>
> Subject: Re: [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early
> exit
>  
> 
> I'll put this on my list to apply if we have an rc4, but I don't think this bug is
> major enough to justify an rc4 if nothing else means we need one.


Agreed.  Thanks Peter!

Taylor

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit
  2021-08-13  3:07 [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Taylor Simpson
  2021-08-13  3:07 ` [PULL 1/1] Hexagon (disas/hexagon.c) fix memory leak for early exit cases Taylor Simpson
  2021-08-13  9:21 ` [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Peter Maydell
@ 2021-08-15 12:15 ` Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2021-08-15 12:15 UTC (permalink / raw)
  To: Taylor Simpson
  Cc: Richard Henderson, QEMU Developers, Philippe Mathieu-Daudé

On Fri, 13 Aug 2021 at 04:07, Taylor Simpson <tsimpson@quicinc.com> wrote:
>
> The following changes since commit 703e8cd6189cf699c8d5c094bc68b5f3afa6ad71:
>
>   Update version for v6.1.0-rc3 release (2021-08-10 19:08:09 +0100)
>
> are available in the git repository at:
>
>   https://github.com/quic/qemu tags/pull-hex-20210812
>
> for you to fetch changes up to a7686d5d8528469b596e98eff098a5d3f8328fb3:
>
>   Hexagon (disas/hexagon.c) fix memory leak for early exit cases (2021-08-12 09:06:05 -0500)
>
> ----------------------------------------------------------------
>
> Don't allocate the string until error conditions have been checked
>
> Fixes: a00cfed0e ("Hexagon (disas) disassembler")
> Eliminate Coverity CID 1460121 (Resource leak)
>
> ----------------------------------------------------------------
> Taylor Simpson (1):
>       Hexagon (disas/hexagon.c) fix memory leak for early exit cases


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-15 12:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  3:07 [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Taylor Simpson
2021-08-13  3:07 ` [PULL 1/1] Hexagon (disas/hexagon.c) fix memory leak for early exit cases Taylor Simpson
2021-08-13  9:21 ` [PULL 0/1] Hexagon (disas/hexagon) fix memory leak for early exit Peter Maydell
2021-08-13 14:57   ` Taylor Simpson
2021-08-15 12:15 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.