Patchwork [-next] drm: tegra: fix missing unlock on error

login
register
mail settings
Submitter Wei Yongjun
Date Dec. 2, 2012, 10:25 a.m.
Message ID <CAPgLHd-UekVrvc8gwNUFaoNtcFcZCNC559GW1wfrmUVHidsiOQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/203198/
State Not Applicable, archived
Headers show

Comments

Wei Yongjun - Dec. 2, 2012, 10:25 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing unlock before return from function host1x_drm_init()
and host1x_drm_exit() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/gpu/drm/tegra/host1x.c | 2 ++
 1 file changed, 2 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thierry Reding - Dec. 2, 2012, 9:12 p.m.
On Sun, Dec 02, 2012 at 05:25:05AM -0500, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing unlock before return from function host1x_drm_init()
> and host1x_drm_exit() in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/gpu/drm/tegra/host1x.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/tegra/host1x.c b/drivers/gpu/drm/tegra/host1x.c
> index bdb97a5..39629e6 100644
> --- a/drivers/gpu/drm/tegra/host1x.c
> +++ b/drivers/gpu/drm/tegra/host1x.c
> @@ -176,6 +176,7 @@ int host1x_drm_init(struct host1x *host1x, struct drm_device *drm)
>  				dev_err(host1x->dev,
>  					"DRM setup failed for %s: %d\n",
>  					dev_name(client->dev), err);
> +				mutex_unlock(&host1x->clients_lock);
>  				return err;
>  			}
>  		}
> @@ -203,6 +204,7 @@ int host1x_drm_exit(struct host1x *host1x)
>  				dev_err(host1x->dev,
>  					"DRM cleanup failed for %s: %d\n",
>  					dev_name(client->dev), err);
> +				mutex_unlock(&host1x->clients_lock);
>  				return err;
>  			}
>  		}

Acked-by: Thierry Reding <thierry.reding@avionic-design.de>

Patch

diff --git a/drivers/gpu/drm/tegra/host1x.c b/drivers/gpu/drm/tegra/host1x.c
index bdb97a5..39629e6 100644
--- a/drivers/gpu/drm/tegra/host1x.c
+++ b/drivers/gpu/drm/tegra/host1x.c
@@ -176,6 +176,7 @@  int host1x_drm_init(struct host1x *host1x, struct drm_device *drm)
 				dev_err(host1x->dev,
 					"DRM setup failed for %s: %d\n",
 					dev_name(client->dev), err);
+				mutex_unlock(&host1x->clients_lock);
 				return err;
 			}
 		}
@@ -203,6 +204,7 @@  int host1x_drm_exit(struct host1x *host1x)
 				dev_err(host1x->dev,
 					"DRM cleanup failed for %s: %d\n",
 					dev_name(client->dev), err);
+				mutex_unlock(&host1x->clients_lock);
 				return err;
 			}
 		}