From patchwork Wed Jul 10 16:47:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshi Kani X-Patchwork-Id: 2825829 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A86A4C0AB2 for ; Wed, 10 Jul 2013 16:48:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 780012017A for ; Wed, 10 Jul 2013 16:48:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35E8A20163 for ; Wed, 10 Jul 2013 16:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754330Ab3GJQr6 (ORCPT ); Wed, 10 Jul 2013 12:47:58 -0400 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:30612 "EHLO g6t0187.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754211Ab3GJQr5 (ORCPT ); Wed, 10 Jul 2013 12:47:57 -0400 Received: from g5t0030.atlanta.hp.com (g5t0030.atlanta.hp.com [16.228.8.142]) by g6t0187.atlanta.hp.com (Postfix) with ESMTP id 0313A28446; Wed, 10 Jul 2013 16:47:57 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.71.12.41]) by g5t0030.atlanta.hp.com (Postfix) with ESMTP id A16CF140FA; Wed, 10 Jul 2013 16:47:56 +0000 (UTC) From: Toshi Kani To: rjw@sisk.pl Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Toshi Kani Subject: [PATCH] ACPI / memhotplug: Fix a stale pointer in error path Date: Wed, 10 Jul 2013 10:47:13 -0600 Message-Id: <1373474833-14047-1-git-send-email-toshi.kani@hp.com> X-Mailer: git-send-email 1.8.1.4 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP device->driver_data needs to be cleared when releasing its data, mem_device, in an error path of acpi_memory_device_add(). Signed-off-by: Toshi Kani Reviewed-by: Yasuaki Ishimatsu --- drivers/acpi/acpi_memhotplug.c | 1 + 1 file changed, 1 insertion(+) -- 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/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index c711d11..999adb5 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c @@ -323,6 +323,7 @@ static int acpi_memory_device_add(struct acpi_device *device, /* Get the range from the _CRS */ result = acpi_memory_get_device_resources(mem_device); if (result) { + device->driver_data = NULL; kfree(mem_device); return result; }