From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ539-0004RM-09 for qemu-devel@nongnu.org; Thu, 25 Feb 2016 18:10:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ535-0006hv-R2 for qemu-devel@nongnu.org; Thu, 25 Feb 2016 18:10:22 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:37542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ535-0006hh-Jh for qemu-devel@nongnu.org; Thu, 25 Feb 2016 18:10:19 -0500 Received: by mail-wm0-x229.google.com with SMTP id g62so48565142wme.0 for ; Thu, 25 Feb 2016 15:10:19 -0800 (PST) Sender: Paolo Bonzini References: <1456237462-3687-1-git-send-email-kraxel@redhat.com> <1456237462-3687-5-git-send-email-kraxel@redhat.com> From: Paolo Bonzini Message-ID: <56CF89D8.5020101@redhat.com> Date: Fri, 26 Feb 2016 00:10:16 +0100 MIME-Version: 1.0 In-Reply-To: <1456237462-3687-5-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 4/8] spice: reset cursor on resize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org Cc: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= On 23/02/2016 15:24, Gerd Hoffmann wrote: > qemu_mutex_lock(&ssd->lock); > + if (c) { > + cursor_get(c); > + } > + cursor_put(ssd->cursor); > + ssd->cursor = c; > ssd->hot_x = c->hot_x; > ssd->hot_y = c->hot_y; Coverity complains that this would dereference a NULL c, and I think it's right; either an unlock+return is missing, or the "if" is unnecessary. Paolo