From patchwork Sun Apr 13 21:55:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 338795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 126731400A4 for ; Mon, 14 Apr 2014 07:56:26 +1000 (EST) Received: from localhost ([::1]:39224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZSNz-0002Iu-Vz for incoming@patchwork.ozlabs.org; Sun, 13 Apr 2014 17:56:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZSNg-0002AB-Og for qemu-devel@nongnu.org; Sun, 13 Apr 2014 17:56:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZSNa-0001ae-KD for qemu-devel@nongnu.org; Sun, 13 Apr 2014 17:56:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZSNa-0001aY-CZ; Sun, 13 Apr 2014 17:55:58 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3DLtsrp030107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 13 Apr 2014 17:55:54 -0400 Received: from thinkpad.redhat.com (vpn-226-164.phx2.redhat.com [10.3.226.164]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3DLtq8d015200; Sun, 13 Apr 2014 17:55:52 -0400 From: Igor Mammedov To: qemu-devel@nongnu.org Date: Sun, 13 Apr 2014 23:55:51 +0200 Message-Id: <1397426151-15239-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: peter.maydell@linaro.org, qemu-stable@nongnu.org, aliguori@amazon.com, mst@redhat.com Subject: [Qemu-devel] [PATCH for-2.0] pc: ACPI BIOS: fix incorrect integer encoding for 0x{F-1}FFFF values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix typo in build_append_int() which causes integer truncation when it's in range 0x{F-1}FFFF by packing it as WordConst instead of required DWordConst. Signed-off-by: Igor Mammedov Reviewed-by: Stefan Weil Reviewed-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 748e866..c3321b5 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -474,7 +474,7 @@ static void build_append_int(GArray *table, uint32_t value) build_append_byte(table, 0x01); /* OneOp */ } else if (value <= 0xFF) { build_append_value(table, value, 1); - } else if (value <= 0xFFFFF) { + } else if (value <= 0xFFFF) { build_append_value(table, value, 2); } else { build_append_value(table, value, 4);