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.
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);
0001-OMAP-iommu-add-initial-debugfs-support.patch
Description: Binary data
