Received: from eggs.gnu.org ([208.118.235.92]:60061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLpn-00017K-P8 for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:49:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFLpk-0008Go-IJ for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:49:27 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60981 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLpk-0008Gd-CR for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:49:24 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 12 Mar 2013 10:49:02 +0100 Message-Id: <1363081758-12913-2-git-send-email-afaerber@suse.de> In-Reply-To: <1363081758-12913-1-git-send-email-afaerber@suse.de> References: <1363081758-12913-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU not found List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Igor Mammedov Commit 55e5c2850 breaks CPU not found return value, and returns CPU corresponding to the last non NULL env. Fix it by returning CPU only if env is not NULL, otherwise CPU is not found and function should return NULL. Signed-off-by: Igor Mammedov Signed-off-by: Andreas F=C3=A4rber --- exec.c | 2 +- 1 Datei ge=C3=A4ndert, 1 Zeile hinzugef=C3=BCgt(+), 1 Zeile entfernt(-) diff --git a/exec.c b/exec.c index 46a2830..0a96ddb 100644 --- a/exec.c +++ b/exec.c @@ -260,7 +260,7 @@ CPUState *qemu_get_cpu(int index) env =3D env->next_cpu; } =20 - return cpu; + return env ? cpu : NULL; } =20 void cpu_exec_init(CPUArchState *env) --=20 1.7.10.4