All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: marcandre.lureau@redhat.com, lichun <lichun@ruijie.com.cn>,
	qemu-devel@nongnu.org, 706701795@qq.com
Subject: Re: [PATCH v2] chardev/tcp: fix error message double free error
Date: Thu, 02 Jul 2020 06:25:35 +0200	[thread overview]
Message-ID: <87lfk28rwg.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <309b915a-9ddc-95a7-f579-7cf66a7c0253@redhat.com> (Paolo Bonzini's message of "Wed, 1 Jul 2020 15:09:08 +0200")

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 01/07/20 09:06, Markus Armbruster wrote:
>> lichun <lichun@ruijie.com.cn> writes:
>> 
>>> Signed-off-by: lichun <lichun@ruijie.com.cn>
>>> ---
>>>  chardev/char-socket.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/chardev/char-socket.c b/chardev/char-socket.c
>>> index afebeec5c3..569d54c144 100644
>>> --- a/chardev/char-socket.c
>>> +++ b/chardev/char-socket.c
>>> @@ -142,6 +142,8 @@ static void check_report_connect_error(Chardev *chr,
>>>                            "Unable to connect character device %s: ",
>>>                            chr->label);
>>>          s->connect_err_reported = true;
>>> +    } else {
>>> +        error_free(err);
>>>      }
>>>      qemu_chr_socket_restart_timer(chr);
>>>  }
>>> @@ -1086,7 +1088,6 @@ static void qemu_chr_socket_connected(QIOTask *task, void *opaque)
>>>      if (qio_task_propagate_error(task, &err)) {
>>>          tcp_chr_change_state(s, TCP_CHARDEV_STATE_DISCONNECTED);
>>>          check_report_connect_error(chr, err);
>>> -        error_free(err);
>>>          goto cleanup;
>>>      }
>> 
>> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>> 
>> and queued, thanks!
>> 
>
> Can you please add a note to the commit message?
>
>     Errors are already freed by error_report_err, so we only need to call
>     error_free when that function is not called.
>     
> and Cc qemu-stable?  Or I can queue it too since it's chardev stuff.

Done in my tree, expect PR later today.



      parent reply	other threads:[~2020-07-02  4:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 21:30 [PATCH v2] chardev/tcp: fix error message double free error lichun
2020-06-25  6:47 ` Markus Armbruster
2020-06-25  9:25   ` Marc-André Lureau
2020-06-28  2:19     ` lichun
2020-07-01  7:06 ` Markus Armbruster
2020-07-01 13:09   ` Paolo Bonzini
2020-07-01 15:12     ` lichun
2020-07-01 15:14       ` Paolo Bonzini
2020-07-02  4:25     ` Markus Armbruster [this message]

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=87lfk28rwg.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=706701795@qq.com \
    --cc=lichun@ruijie.com.cn \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.