[Spice-devel] [PATCH 11/11] worker: remove assertion on alloc_drawable

Christophe Fergeau cfergeau at redhat.com
Fri Oct 30 09:23:45 PDT 2015


On Thu, Oct 29, 2015 at 04:24:27PM -0400, Frediano Ziglio wrote:
> > 
> > From: Marc-André Lureau <marcandre.lureau at gmail.com>
> > 
> > There is no guarantee in the code that this can't be hit, so we should
> > cope with it (the condition can be reached easily by running the server
> > without waiting for blocked clients or pipe size)
> > 
> > The following commit will attempt to address this.
> > ---
> >  server/red_worker.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/server/red_worker.c b/server/red_worker.c
> > index 0542b29..ca7e8bf 100644
> > --- a/server/red_worker.c
> > +++ b/server/red_worker.c
> > @@ -3300,7 +3300,8 @@ static void free_one_drawable(RedWorker *worker, int
> > force_glz_free)
> >      Drawable *drawable;
> >      Container *container;
> >  
> > -    spice_assert(ring_item);
> > +    if (!ring_item)
> > +        return;
> >      drawable = SPICE_CONTAINEROF(ring_item, Drawable, list_link);
> >      if (force_glz_free) {
> >          RingItem *glz_item, *next_item;
> > --
> > 2.4.3
> > 
> 
> The change make sense. The function is called from different places and not in all path
> we are sure worker->current_list is not empty.
> 
> Style note: looks like we prefer always bracket like
> 
> if (!ring_item) {
>     return;
> }
> 
> Beside the style note I would ack the patch.

Brackets would probably be more consistent yes, ack too.

Christophe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151030/9f4bd139/attachment.sig>


More information about the Spice-devel mailing list