Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754356Ab0DSB6Y (ORCPT ); Sun, 18 Apr 2010 21:58:24 -0400 Received: from qw-out-2122.google.com ([74.125.92.24]:1740 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754114Ab0DSB6X (ORCPT ); Sun, 18 Apr 2010 21:58:23 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:from:date:message-id:subject:to:cc :content-type; b=FCqK8U56YMJLf3jAdJ2Hl1e1paKxHnB6DTOHbJxiYaHFD52OdJM98uxPJH2U808LaX JEN0CxWPWLvDn2QBrKKyxkFMWDLDs97z9+WogFWgpECPZwvpxVHecXErvYZ2Sue8/KnN lXN0MCyBvXG8oJXaisKkU9it0iw7TMhsbtVM4= MIME-Version: 1.0 Reply-To: axel.lin@gmail.com From: Axel Lin Date: Mon, 19 Apr 2010 09:58:02 +0800 Message-ID: Subject: [PATCH] mc13783-regulator: fix a memory leak in mc13783_regulator_remove To: linux-kernel Cc: Sascha Hauer , Liam Girdwood , Mark Brown , Samuel Ortiz Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1226 Lines: 37 This patch fixes a memory leak by freeing priv in mc13783_regulator_remove Signed-off-by: Axel Lin Cc: Sascha Hauer Cc: Liam Girdwood Cc: Mark Brown Cc: Samuel Ortiz --- drivers/regulator/mc13783-regulator.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index a681f5e..ad036dd 100644 --- a/drivers/regulator/mc13783-regulator.c +++ b/drivers/regulator/mc13783-regulator.c @@ -618,9 +618,12 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev) dev_get_platdata(&pdev->dev); int i; + platform_set_drvdata(pdev, NULL); + for (i = 0; i < pdata->num_regulators; i++) regulator_unregister(priv->regulators[i]); + kfree(priv); return 0; } -- 1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/