Message ID | 20090827.102539.246514996.Hiroshi.DOYU@nokia.com (mailing list archive) |
---|---|
State | Awaiting Upstream, archived |
Headers | show |
* Hiroshi DOYU <Hiroshi.DOYU@nokia.com> [090827 00:26]: > Hi Tony, > > I fixed the error exit path as below and attached the updated verion > of the patch. Please replace the old one in for-next with the attached > one. OK will update. Tony > Modified arch/arm/plat-omap/iommu-debug.c > 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); > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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);