From patchwork Thu Aug 27 07:25:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hiroshi DOYU X-Patchwork-Id: 44209 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7R7QYS9016977 for ; Thu, 27 Aug 2009 07:26:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751230AbZH0H0a (ORCPT ); Thu, 27 Aug 2009 03:26:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751279AbZH0H0a (ORCPT ); Thu, 27 Aug 2009 03:26:30 -0400 Received: from smtp.nokia.com ([192.100.122.233]:32587 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751230AbZH0H03 (ORCPT ); Thu, 27 Aug 2009 03:26:29 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7R7Ppp6012827; Thu, 27 Aug 2009 10:26:00 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Aug 2009 10:25:47 +0300 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Aug 2009 10:25:46 +0300 Received: from localhost (esdhcp04130.research.nokia.com [172.21.41.30]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n7R7PaNL031987; Thu, 27 Aug 2009 10:25:37 +0300 Date: Thu, 27 Aug 2009 10:25:39 +0300 (EEST) Message-Id: <20090827.102539.246514996.Hiroshi.DOYU@nokia.com> To: tony@atomide.com Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-omap@vger.kernel.org, linux@arm.linux.org.uk Subject: Re: [PATCH 02/10] OMAP: iommu: add initial debugfs support From: Hiroshi DOYU In-Reply-To: <20090817.102805.48505615.Hiroshi.DOYU@nokia.com> References: <20090816151347.GZ7278@atomide.com> <20090816204732.GA23875@n2100.arm.linux.org.uk> <20090817.102805.48505615.Hiroshi.DOYU@nokia.com> X-Mailer: Mew version 5.2 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 X-OriginalArrivalTime: 27 Aug 2009 07:25:46.0706 (UTC) FILETIME=[983F3320:01CA26E7] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/plat-omap/iommu-debug.c b/arch/arm/plat-omap/iommu-debug.c index 5a7e409..c799b3b 100644 --- a/arch/arm/plat-omap/iommu-debug.c +++ b/arch/arm/plat-omap/iommu-debug.c @@ -268,14 +268,14 @@ static ssize_t debug_read_mem(struct file *file, char __user *userbuf, area = find_iovm_area(obj, (u32)ppos); if (IS_ERR(area)) { - mutex_unlock(&iommu_debug_lock); - return -EINVAL; + bytes = -EINVAL; + goto err_out; } memcpy(p, area->va, count); p += count; bytes = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); - +err_out: mutex_unlock(&iommu_debug_lock); free_page((unsigned long)buf); @@ -299,17 +299,17 @@ static ssize_t debug_write_mem(struct file *file, const char __user *userbuf, mutex_lock(&iommu_debug_lock); if (copy_from_user(p, userbuf, count)) { - mutex_unlock(&iommu_debug_lock); - return -EFAULT; + count = -EFAULT; + goto err_out; } area = find_iovm_area(obj, (u32)ppos); if (IS_ERR(area)) { - mutex_unlock(&iommu_debug_lock); - return -EINVAL; + count = -EINVAL; + goto err_out; } memcpy(area->va, p, count); - +err_out: mutex_unlock(&iommu_debug_lock); free_page((unsigned long)buf);