From patchwork Thu May 20 14:29:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjugk manjugk X-Patchwork-Id: 101198 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4KEUkoe020610 for ; Thu, 20 May 2010 14:30:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755121Ab0ETOac (ORCPT ); Thu, 20 May 2010 10:30:32 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:39944 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755092Ab0ETOa1 (ORCPT ); Thu, 20 May 2010 10:30:27 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o4KEUNcY028061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 May 2010 09:30:25 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id o4KEUK0r019679; Thu, 20 May 2010 20:00:22 +0530 (IST) From: Manjunatha GK To: linux-omap@vger.kernel.org Cc: Satish , Tony Lindgren Subject: [PATCH] OMAP: Fix Memory leak Date: Thu, 20 May 2010 19:59:52 +0530 Message-Id: <1274365792-24938-4-git-send-email-manjugk@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1274365792-24938-1-git-send-email-manjugk@ti.com> References: <1274365792-24938-1-git-send-email-manjugk@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 20 May 2010 14:30:46 +0000 (UTC) diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c index e43983b..8ce0de2 100644 --- a/arch/arm/plat-omap/iovmm.c +++ b/arch/arm/plat-omap/iovmm.c @@ -140,8 +140,10 @@ static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags) return ERR_PTR(-ENOMEM); err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL); - if (err) + if (err) { + kfree(sgt); return ERR_PTR(err); + } pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries);