From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ5GP-0008RA-0q for qemu-devel@nongnu.org; Thu, 25 Feb 2016 18:24:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZ5GJ-0001dO-Ki for qemu-devel@nongnu.org; Thu, 25 Feb 2016 18:24:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZ5GJ-0001cu-Fr for qemu-devel@nongnu.org; Thu, 25 Feb 2016 18:23:59 -0500 References: <1456237462-3687-1-git-send-email-kraxel@redhat.com> <1456237462-3687-5-git-send-email-kraxel@redhat.com> <56CF89D8.5020101@redhat.com> From: Paolo Bonzini Message-ID: <56CF8D09.302@redhat.com> Date: Fri, 26 Feb 2016 00:23:53 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Gerd Hoffmann , QEMU On 26/02/2016 00:23, Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Fri, Feb 26, 2016 at 12:10 AM, Paolo Bonzini w= rote: >> >> >> 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 =3D c; >>> ssd->hot_x =3D c->hot_x; >>> ssd->hot_y =3D 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 unneces= sary. >> >=20 > Oops, I don't know why there is a if there, it's unnecessary indeed. > ACK if you did the patch already ;) No I didn't. :) Paolo