From patchwork Thu Jun 27 10:55:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 255036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id B3B172C0082 for ; Thu, 27 Jun 2013 20:55:22 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Us9rF-0007KE-KP; Thu, 27 Jun 2013 10:55:21 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Us9rA-0007K4-IS for fwts-devel@lists.ubuntu.com; Thu, 27 Jun 2013 10:55:16 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Us9rA-0005HE-FS for fwts-devel@lists.ubuntu.com; Thu, 27 Jun 2013 10:55:16 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpica: nspredef: fix null pointer dereference issue (LP: #1195251) Date: Thu, 27 Jun 2013 11:55:16 +0100 Message-Id: <1372330516-24433-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King I found that a _WAK that does not return a package trips a null pointer reference. Check for a null pointer before the dereferencing of *ReturnObjectPtr. This is a hot fix workaround, we should pick up the official fix in later version of ACPICA. Signed-off-by: Colin Ian King Acked-by: Keng-Yu Lin Acked-by: Alex Hung --- src/acpica/source/components/namespace/nspredef.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/acpica/source/components/namespace/nspredef.c b/src/acpica/source/components/namespace/nspredef.c index 941c3bd..e7bc55b 100644 --- a/src/acpica/source/components/namespace/nspredef.c +++ b/src/acpica/source/components/namespace/nspredef.c @@ -237,6 +237,11 @@ AcpiNsCheckReturnValue ( goto Exit; } + if (!(*ReturnObjectPtr)) + { + Status = AE_AML_NO_RETURN_VALUE; + goto Exit; + } /* * For returned Package objects, check the type of all sub-objects. * Note: Package may have been newly created by call above.