From: Anthony Liguori <anthony@codemonkey.ws>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] vnc_refresh: return if vd->timer is NULL
Date: Tue, 12 Jan 2010 13:35:29 -0600 [thread overview]
Message-ID: <4B4CCF01.4030605@codemonkey.ws> (raw)
In-Reply-To: <alpine.DEB.2.00.1001111725500.14945@kaball-desktop>
On 01/11/2010 11:30 AM, Stefano Stabellini wrote:
> Hi all,
> calling vnc_update_client in vnc_refresh might have the unlikely side
> effect of setting vd->timer = NULL, if the last vnc client disconnected.
> In this case we have to return from vnc_refresh without updating the
> timer, otherwise we cause a segfault.
>
> Signed-off-by: Stefano Stabellini<stefano.stabellini@eu.citrix.com>
>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
>
> diff --git a/vnc.c b/vnc.c
> index c54c6e0..58eac73 100644
> --- a/vnc.c
> +++ b/vnc.c
> @@ -2305,6 +2305,10 @@ static void vnc_refresh(void *opaque)
> rects += vnc_update_client(vs, has_dirty);
> vs = vs->next;
> }
> + /* vd->timer could be NULL now if the last client disconnected,
> + * in this case don't update the timer */
> + if (vd->timer == NULL)
> + return;
>
> if (has_dirty&& rects) {
> vd->timer_interval /= 2;
>
>
>
>
prev parent reply other threads:[~2010-01-12 19:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-11 17:30 [Qemu-devel] [PATCH] vnc_refresh: return if vd->timer is NULL Stefano Stabellini
2010-01-12 19:35 ` Anthony Liguori [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=4B4CCF01.4030605@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).