diff mbox

arm: omap: iovmm: add missing mutex_unlock

Message ID 1254001039-27976-1-git-send-email-dwalker@fifo99.com (mailing list archive)
State Accepted
Commit d3b34e8cb9c654902b5e486fbf27849dea48eeaf
Headers show

Commit Message

Daniel Walker Sept. 26, 2009, 9:37 p.m. UTC
I was using Coccinelle with the mutex_unlock semantic patch, and it
unconvered this problem. It appears to be a valid missing unlock issue.
This change should correct it by moving the unlock below the label.

This patch is against the mainline kernel.

Cc: Julia Lawall <julia@diku.dk>
Cc: Kevin Hilman <khilman@deeprooted.net>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Daniel Walker <dwalker@fifo99.com>
---
 arch/arm/plat-omap/iovmm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Kevin Hilman Sept. 28, 2009, 4:51 p.m. UTC | #1
Daniel Walker <dwalker@fifo99.com> writes:

> I was using Coccinelle with the mutex_unlock semantic patch, and it
> unconvered this problem. It appears to be a valid missing unlock issue.
> This change should correct it by moving the unlock below the label.
>
> This patch is against the mainline kernel.
>
> Cc: Julia Lawall <julia@diku.dk>
> Cc: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Daniel Walker <dwalker@fifo99.com>

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>

> ---
>  arch/arm/plat-omap/iovmm.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
> index 57f7122..9b6cb90 100644
> --- a/arch/arm/plat-omap/iovmm.c
> +++ b/arch/arm/plat-omap/iovmm.c
> @@ -363,8 +363,9 @@ void *da_to_va(struct iommu *obj, u32 da)
>  		goto out;
>  	}
>  	va = area->va;
> -	mutex_unlock(&obj->mmap_lock);
>  out:
> +	mutex_unlock(&obj->mmap_lock);
> +
>  	return va;
>  }
>  EXPORT_SYMBOL_GPL(da_to_va);
> -- 
> 1.6.0.4
>
> --
> 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
--
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 mbox

Patch

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 57f7122..9b6cb90 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -363,8 +363,9 @@  void *da_to_va(struct iommu *obj, u32 da)
 		goto out;
 	}
 	va = area->va;
-	mutex_unlock(&obj->mmap_lock);
 out:
+	mutex_unlock(&obj->mmap_lock);
+
 	return va;
 }
 EXPORT_SYMBOL_GPL(da_to_va);