From patchwork Wed Sep 16 08:40:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 47849 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 n8G8eesw004814 for ; Wed, 16 Sep 2009 08:40:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751751AbZIPIkg (ORCPT ); Wed, 16 Sep 2009 04:40:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751392AbZIPIkf (ORCPT ); Wed, 16 Sep 2009 04:40:35 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:40216 "EHLO mail-ew0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753243AbZIPIkf (ORCPT ); Wed, 16 Sep 2009 04:40:35 -0400 Received: by ewy2 with SMTP id 2so1206396ewy.17 for ; Wed, 16 Sep 2009 01:40:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=bNaMhhKC5casgMSjyB52Pfvhwz655qve4TnmD2alGB8=; b=AFxPBz51taM77fKaT51xpnaba3oKDIr+KNOMdfz51gvnNhH1TVR37RN0FVv+MaZmE7 DLbcDLmdAGF3IPnZIgku+DJpSCgpOZBKTRUNbS+91ot/jXwNkcr9W9Gn3YPp8F/bNspB z/wA0fBcl918CmfJVKUnTJhk1EYuwgDaYHUKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=RmZ01O+3oLTgroPQzbODLNr8QAXdGS4cgiz9JxaBhLUTYYM1iCaW0TA8OZwRpkdRaB del8mHXFEch5A2HBH5lCzsiqTLFU3qGPlqTYKD6UNTlALk9J8ScPVS+SOLWcAc5pyQDb yqVpvQzpVG2J39chFZwacYRf5Z5SdW60YSQTY= Received: by 10.211.128.14 with SMTP id f14mr1966832ebn.75.1253090436337; Wed, 16 Sep 2009 01:40:36 -0700 (PDT) Received: from ?192.168.0.5? ([86.53.68.233]) by mx.google.com with ESMTPS id 10sm2536892eyz.42.2009.09.16.01.40.34 (version=SSLv3 cipher=RC4-MD5); Wed, 16 Sep 2009 01:40:35 -0700 (PDT) Message-ID: <4AB0A481.40306@tuffmail.co.uk> Date: Wed, 16 Sep 2009 09:40:33 +0100 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Len Brown CC: linux acpi Subject: [PATCH] ACPI processor: fix theoretical memleak Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Signed-off-by: Alan Jenkins --- drivers/acpi/processor_core.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 38ad5ef..0eb4a94 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -781,8 +781,8 @@ static int acpi_processor_add(struct acpi_device *device) return -ENOMEM; if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) { - kfree(pr); - return -ENOMEM; + result = -ENOMEM; + goto err_free_pr; } pr->handle = device->handle; @@ -882,6 +882,8 @@ err_remove_fs: acpi_processor_remove_fs(device); err_free_cpumask: free_cpumask_var(pr->throttling.shared_cpu_map); +err_free_pr: + kfree(pr); return result; }