From patchwork Fri Jul 6 13:54:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush X-Patchwork-Id: 9888 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2A06B23E1B for ; Fri, 6 Jul 2012 13:40:50 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id CE994A185F4 for ; Fri, 6 Jul 2012 13:40:49 +0000 (UTC) Received: by yenq6 with SMTP id q6so9200391yen.11 for ; Fri, 06 Jul 2012 06:40:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:x-brightmail-tracker:x-tm-as-mml :cc:subject:x-beenthere:x-mailman-version:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:sender :errors-to:x-gm-message-state; bh=Yo+i8TeiSNknhfRl36xE8P7q/wtwXzjtm5HqxI/81o4=; b=OpWLaR4mLB6yEXJ4/Bm2+YdLP2T0HbodEWR8jhOYeMbFK851THRWiGVHlwAmdYYcGj O1cF9RXv9NgGa6VRBqVnEwy88kJYnfmgCMI5GHbEwsngcTnD+mF/bCGj3j+KdDHFMO0v 9Cb6AtYu3vd+RCdwn8kYJY+O6IlzHsBj+6wnrG2urjc60ggTa4/WkFfKkdB0c4NA6Rax eA+aEhHhqLQ0yPyrNFalQ0xVR/dg0RXSVKWV5nuiCBQ8DAufLaqPRCUJR/3ikJhwuYdj RTsbXikx39e9qCXENvO74M11A0avZ5+UGC1v0fqY4i5a41YDeW8QixB2CADstMd9yuGi TjXA== Received: by 10.42.210.193 with SMTP id gl1mr15579517icb.57.1341582048977; Fri, 06 Jul 2012 06:40:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp10801ibb; Fri, 6 Jul 2012 06:40:47 -0700 (PDT) Received: by 10.14.27.201 with SMTP id e49mr7230873eea.230.1341582046951; Fri, 06 Jul 2012 06:40:46 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id dy10si7237456wib.1.2012.07.06.06.40.45; Fri, 06 Jul 2012 06:40:46 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sn8m0-0004lf-QL; Fri, 06 Jul 2012 13:40:40 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sn8ly-0004lZ-SQ for linaro-mm-sig@lists.linaro.org; Fri, 06 Jul 2012 13:40:39 +0000 Received: from epcpsbgm1.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6Q00GM4RBMBN10@mailout1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 06 Jul 2012 22:40:34 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-6d-4ff6ead2f566 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B6.99.19326.2DAE6FF4; Fri, 06 Jul 2012 22:40:34 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M6Q00JXLRBCCY80@mmp2.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 06 Jul 2012 22:40:34 +0900 (KST) From: Prathyush K To: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org Date: Fri, 06 Jul 2012 19:24:15 +0530 Message-id: <1341582855-4251-1-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.7.0.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNJMWRmVeSWpSXmKPExsVy+t9jQd1Lr775G2xuMbL4cuUhkwOjx+1/ j5kDGKO4bFJSczLLUov07RK4MlYem8lW8Fi44vGBy0wNjKcEuxg5OSQETCQeTDzGBGGLSVy4 t56ti5GLQ0hgOqPEpBvfWSGcVUwSGxo+soBUsQloS/yac5cVxBYRiJM4vvIWWDezgKXEk/2v weLCAr4SE5ZOZwOxWQRUJe7tagSL8wq4SZzq7mGB2KYg0brsEPsERu4FjAyrGEVTC5ILipPS cw31ihNzi0vz0vWS83M3MYK9+ExqB+PKBotDjAIcjEo8vAzPvvkLsSaWFVfmHmKU4GBWEuFV WQEU4k1JrKxKLcqPLyrNSS0+xCjNwaIkzmvs/dVfSCA9sSQ1OzW1ILUIJsvEwSnVwLht1udq 3rqIU6pWp1KE9rNv/LBl8oazzxwfqVzhzmjacX3BP9OvYdfDtzP9VXx43ecHq4H6+bAckXbp CRa6N47E5ItopBpm/mjq3zJhjtpPjucRL0/pXV/iUmaz943YgkeOdzt03j4W002U0D26bI+k dFisUd3C0pfd2WueH1ywLDdCeP2ukGwlluKMREMt5qLiRAD+Iwqn3gEAAA== X-TM-AS-MML: No Cc: subash.ramaswamy@linaro.org Subject: [Linaro-mm-sig] [PATCH] ARM: dma-mapping: modify condition check while freeing pages X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQk0gqtlEZqSfdggNvh6aLOxQj3n4JvHFPkv0atH5q1/edigmC+FZ+EpglPwp86a+3i6R59M WARNING: at mm/vmalloc.c:1471 __iommu_free_buffer+0xcc/0xd0() Trying to vfree() nonexistent vm area (ef095000) Modules linked in: [] (unwind_backtrace+0x0/0xfc) from [] (warn_slowpath_common+0x54/0x64) [] (warn_slowpath_common+0x54/0x64) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt+0x30/0x40) from [] (__iommu_free_buffer+0xcc/0xd0) [] (__iommu_free_buffer+0xcc/0xd0) from [] (exynos_drm_free_buf+0xe4/0x138) [] (exynos_drm_free_buf+0xe4/0x138) from [] (exynos_drm_gem_destroy+0x80/0xfc) [] (exynos_drm_gem_destroy+0x80/0xfc) from [] (drm_gem_object_free+0x28/0x34) [] (drm_gem_object_free+0x28/0x34) from [] (drm_gem_object_release_handle+0xcc/0xd8) [] (drm_gem_object_release_handle+0xcc/0xd8) from [] (idr_for_each+0x74/0xb8) [] (idr_for_each+0x74/0xb8) from [] (drm_gem_release+0x1c/0x30) [] (drm_gem_release+0x1c/0x30) from [] (drm_release+0x608/0x694) [] (drm_release+0x608/0x694) from [] (fput+0xb8/0x228) [] (fput+0xb8/0x228) from [] (filp_close+0x64/0x84) [] (filp_close+0x64/0x84) from [] (put_files_struct+0xe8/0x104) [] (put_files_struct+0xe8/0x104) from [] (do_exit+0x608/0x774) [] (do_exit+0x608/0x774) from [] (do_group_exit+0x48/0xb4) [] (do_group_exit+0x48/0xb4) from [] (sys_exit_group+0x10/0x18) [] (sys_exit_group+0x10/0x18) from [] (ret_fast_syscall+0x0/0x30) This patch modifies the condition while freeing to match the condition used while allocation. This fixes the above warning which arises when array size is equal to PAGE_SIZE where allocation is done using kzalloc but free is done using vfree. Signed-off-by: Prathyush K --- arch/arm/mm/dma-mapping.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index dc560dc..62fefac 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1106,7 +1106,7 @@ static int __iommu_free_buffer(struct device *dev, struct page **pages, size_t s for (i = 0; i < count; i++) if (pages[i]) __free_pages(pages[i], 0); - if (array_size < PAGE_SIZE) + if (array_size <= PAGE_SIZE) kfree(pages); else vfree(pages);