From patchwork Tue Mar 29 03:12:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 670512 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2T3CkFQ017491 for ; Tue, 29 Mar 2011 03:12:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755540Ab1C2DMp (ORCPT ); Mon, 28 Mar 2011 23:12:45 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:39379 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755505Ab1C2DMp (ORCPT ); Mon, 28 Mar 2011 23:12:45 -0400 Received: by fxm17 with SMTP id 17so3159234fxm.19 for ; Mon, 28 Mar 2011 20:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=Que6HclbXCuPEEPeyfk8hKgjKvgMSuwW2Ai5DniWKRI=; b=uRDG06SD7JpFC+gdXvJm5LXYq6JSD0eMJ18yYIIfjXyUXDSE1HuenCGcfp6n14fgAE cfnHSIZ2N5Eqg0xqoBR47tb2HQNhcLYnBNtOBlmA6bt07PG5+SgupsDdVcBnon3jfzXe HQvfzhaigkBYqhKsq2D13hsHPm6/Ob8NMrEII= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=Jb2g7JseT3X9GOIqpG5XugQ9h9DniyQAw3mQ7dPwI4JndPuNzdaXlxPFXh57sfrqLK JwmuFSgon2h25U8xHZ/rJ3CccEMo+hC9QtACRj4O8nYX9ohV6HKiotM/6amTE3b6hXjX f9UDBs5W6ZeZzOCsrJmvfLg3i4Q4sm4aKFG0g= Received: by 10.223.6.11 with SMTP id 11mr5233223fax.103.1301368363614; Mon, 28 Mar 2011 20:12:43 -0700 (PDT) Received: from bicker ([212.49.88.34]) by mx.google.com with ESMTPS id 21sm1747336fav.41.2011.03.28.20.12.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Mar 2011 20:12:42 -0700 (PDT) Date: Tue, 29 Mar 2011 06:12:10 +0300 From: Dan Carpenter To: Len Brown Cc: linux-acpi@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] ACPI: use after free in acpi_battery_add() Message-ID: <20110329031210.GA9856@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 29 Mar 2011 03:12:47 +0000 (UTC) diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index fcc13ac..cfc7a5b 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -988,6 +988,7 @@ static int acpi_battery_add(struct acpi_device *device) acpi_battery_remove_fs(device); #endif kfree(battery); + return result; } battery->pm_nb.notifier_call = battery_notify;