From patchwork Mon Nov 22 08:44:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 347101 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 oAM8dUwN018008 for ; Mon, 22 Nov 2010 08:39:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318Ab0KVIj3 (ORCPT ); Mon, 22 Nov 2010 03:39:29 -0500 Received: from mail-gx0-f174.google.com ([209.85.161.174]:50306 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953Ab0KVIj3 (ORCPT ); Mon, 22 Nov 2010 03:39:29 -0500 Received: by gxk23 with SMTP id 23so3888131gxk.19 for ; Mon, 22 Nov 2010 00:39:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=BAAa6yYzLp1h+ipoWNortvLPdyLYYOvFvf1nax0uBw0=; b=rXDulQpb10/8CTE3pAyk47y4WTTh5sOCiBirLP0jA73aPVWdnokAdjMZlsE60Z4rG2 Nk0MaS8jhTHrckrYGflBARkYimf2kHxVHIgBuCxggATU5ytdDYEsrfwCGD1Mly9YZYgi TYRzN7pv5+3B2GQtKimS+Jt7p5e/z5nEF8jLY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=sl0hTJRQ3HH3I47DvpIg+wwflg86C0FltYdOn7Re1cbEyy6IyJvF8zoo/JecwLtui/ 8AuBikg/RuklzZVChiVjNZ0rXjtq+gFqWxZ1eErc1I0tj3oKhdGZNt5CTkYZxR+GcI3R beZXGfLmN763Or3xNWpakhT1wvnNTYMY9Ivwo= Received: by 10.151.15.16 with SMTP id s16mr4444940ybi.41.1290415167552; Mon, 22 Nov 2010 00:39:27 -0800 (PST) Received: from [192.168.100.50] (60-251-136-127.HINET-IP.hinet.net [60.251.136.127]) by mx.google.com with ESMTPS id s36sm3117148yhg.26.2010.11.22.00.39.24 (version=SSLv3 cipher=RC4-MD5); Mon, 22 Nov 2010 00:39:27 -0800 (PST) Subject: [PATCH 1/4] [ARM] davinci_mmc: fix a memory leak From: Axel Lin To: linux-kernel Cc: Chris Ball , Andrew Morton , Vipin Bhandari , David Brownell , linux-mmc@vger.kernel.org In-Reply-To: <1290415359.5471.4.camel@mola> References: <1290415359.5471.4.camel@mola> Date: Mon, 22 Nov 2010 16:44:27 +0800 Message-Id: <1290415467.5471.7.camel@mola> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Nov 2010 08:39:31 +0000 (UTC) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index e15547c..7c7d268 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1297,7 +1297,7 @@ cpu_freq_fail: mmc_free_host(mmc); if (mem) - release_resource(mem); + release_mem_region(mem->start, resource_size(mem)); dev_dbg(&pdev->dev, "probe err %d\n", ret); @@ -1322,7 +1322,8 @@ static int __exit davinci_mmcsd_remove(struct platform_device *pdev) iounmap(host->base); - release_resource(host->mem_res); + release_mem_region(host->mem_res->start, + resource_size(host->mem_res)); mmc_free_host(host->mmc); }