All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: "pbonzini@redhat.com" <pbonzini@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: [PATCH 2/4] vl: Free accel_list in configure_accelerators
Date: Thu, 9 Jan 2020 12:59:04 +0100	[thread overview]
Message-ID: <CAL1e-=jPcBBRxJ8PmDzus7w_p_JObuYbx0_sE-m4x969MePJRA@mail.gmail.com> (raw)
In-Reply-To: <373c37b0-812d-2bcd-4983-7999d19dde66@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]

On Thursday, January 9, 2020, Laurent Vivier <lvivier@redhat.com> wrote:

> On 09/01/2020 09:18, Thomas Huth wrote:
> > On 09/01/2020 03.17, Richard Henderson wrote:
> >> We allocate the list with g_strsplit, so free it too.
> >> This freeing was lost during one of the rearrangements.
> >>
> >> Fixes: 6f6e1698a68c
> >> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> >> ---
> >>  vl.c | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/vl.c b/vl.c
> >> index be79b03c1a..c9329fe699 100644
> >> --- a/vl.c
> >> +++ b/vl.c
> >> @@ -2748,7 +2748,6 @@ static int do_configure_accelerator(void *opaque,
> QemuOpts *opts, Error **errp)
> >>  static void configure_accelerators(const char *progname)
> >>  {
> >>      const char *accel;
> >> -    char **accel_list, **tmp;
> >>      bool init_failed = false;
> >>
> >>      qemu_opts_foreach(qemu_find_opts("icount"),
> >> @@ -2756,6 +2755,8 @@ static void configure_accelerators(const char
> *progname)
> >>
> >>      accel = qemu_opt_get(qemu_get_machine_opts(), "accel");
> >>      if (QTAILQ_EMPTY(&qemu_accel_opts.head)) {
> >> +        char **accel_list, **tmp;
> >> +
> >>          if (accel == NULL) {
> >>              /* Select the default accelerator */
> >>              if (!accel_find("tcg") && !accel_find("kvm")) {
> >> @@ -2787,6 +2788,7 @@ static void configure_accelerators(const char
> *progname)
> >>                  error_report("invalid accelerator %s", *tmp);
> >>              }
> >>          }
> >> +        g_strfreev(accel_list);
> >>      } else {
> >>          if (accel != NULL) {
> >>              error_report("The -accel and \"-machine accel=\" options
> are incompatible");
> >>
> >
> > FYI, a fix for this is already part of Laurent's "Trivial branch
> > patches" PULL request from yesterday.
>
> https://patchew.org/QEMU/20200108160233.991134-1-laurent@
> vivier.eu/20200108160233.991134-6-laurent@vivier.eu/
>
>
If this (from Laurent's PR) patch is merged, Richard could transform his
patch into "vl: Fix the scope of variables accel_list and tmp in
configure_accelerator()" in v2.

Whatever happens:

Reviewed by: Aleksandar Markovic <amarkovic@wavecomp.com>


> Thanks,
> Laurent
>
>
>

[-- Attachment #2: Type: text/html, Size: 3493 bytes --]

  reply	other threads:[~2020-01-09 12:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  2:17 [PATCH 0/4] vl: Fixes for cleanups to -accel Richard Henderson
2020-01-09  2:17 ` [PATCH 1/4] vl: Remove unused variable in configure_accelerators Richard Henderson
2020-01-09 11:01   ` Alex Bennée
2020-01-09 12:06   ` Aleksandar Markovic
2020-01-09 12:23   ` Philippe Mathieu-Daudé
2020-01-09  2:17 ` [PATCH 2/4] vl: Free accel_list " Richard Henderson
2020-01-09  8:18   ` Thomas Huth
2020-01-09  8:24     ` Laurent Vivier
2020-01-09 11:59       ` Aleksandar Markovic [this message]
2020-01-09 11:04   ` Alex Bennée
2020-01-09  2:17 ` [PATCH 3/4] vl: Remove useless test " Richard Henderson
2020-01-09 11:05   ` Alex Bennée
2020-01-09 12:07   ` Aleksandar Markovic
2020-01-09 12:24   ` Philippe Mathieu-Daudé
2020-01-09  2:17 ` [PATCH 4/4] vl: Only choose enabled accelerators " Richard Henderson
2020-01-09 11:35   ` Alex Bennée
2020-01-09 12:10     ` Aleksandar Markovic
2020-01-09  9:00 ` [PATCH 0/4] vl: Fixes for cleanups to -accel Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL1e-=jPcBBRxJ8PmDzus7w_p_JObuYbx0_sE-m4x969MePJRA@mail.gmail.com' \
    --to=aleksandar.m.mail@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.