From patchwork Mon Sep 21 19:28:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 49090 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8LJSloR009091 for ; Mon, 21 Sep 2009 19:28:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303AbZIUT2q (ORCPT ); Mon, 21 Sep 2009 15:28:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753318AbZIUT2q (ORCPT ); Mon, 21 Sep 2009 15:28:46 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:31231 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753303AbZIUT2q (ORCPT ); Mon, 21 Sep 2009 15:28:46 -0400 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g1t0028.austin.hp.com (Postfix) with ESMTP id 4B6141C1DD; Mon, 21 Sep 2009 19:28:50 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0018.houston.hp.com (Postfix) with ESMTP id 0649E100A0; Mon, 21 Sep 2009 19:28:49 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 0510ECF000E; Mon, 21 Sep 2009 13:28:50 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 54xr27601blX; Mon, 21 Sep 2009 13:28:49 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id E28FBCF000D; Mon, 21 Sep 2009 13:28:49 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id BC4BF2615C; Mon, 21 Sep 2009 13:28:49 -0600 (MDT) Subject: [PATCH v3 01/17] ACPICA: fixup after acpi_get_object_info() change To: Len Brown From: Bjorn Helgaas Cc: linux-acpi@vger.kernel.org, Gary Hade , Bob Moore , Lin Ming Date: Mon, 21 Sep 2009 13:28:49 -0600 Message-ID: <20090921192849.21322.99657.stgit@bob.kio> In-Reply-To: <20090921192656.21322.23072.stgit@bob.kio> References: <20090921192656.21322.23072.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Commit 15b8dd53f5ffa changed info->hardware_id from a static array to a pointer. If hardware_id is non-NULL, it points to a NULL-terminated string, so we don't need to terminate it explicitly. However, it may be NULL; in that case, we *can't* add a NULL terminator. This causes a NULL pointer dereference oops for devices without _HID. Signed-off-by: Bjorn Helgaas CC: Lin Ming CC: Bob Moore CC: Gary Hade --- drivers/pci/hotplug/acpiphp_ibm.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index a9d926b..e7be66d 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c @@ -406,7 +406,6 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, __func__, status); return retval; } - info->hardware_id.string[sizeof(info->hardware_id.length) - 1] = '\0'; if (info->current_status && (info->valid & ACPI_VALID_HID) && (!strcmp(info->hardware_id.string, IBM_HARDWARE_ID1) ||