diff mbox series

thunderbolt: unlock on error path in tb_domain_add()

Message ID YFnqyqDzSHenVN9O@mwanda (mailing list archive)
State Accepted
Commit 2e7a5b3e22368b65583d1b717e267de0a5906c32
Headers show
Series thunderbolt: unlock on error path in tb_domain_add() | expand

Commit Message

Dan Carpenter March 23, 2021, 1:19 p.m. UTC
We accidentally deleted this unlock on the error path.  Undelete it.

Fixes: 7f0a34d7900b ("thunderbolt: Decrease control channel timeout for software connection manager")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/thunderbolt/domain.c | 1 +
 1 files changed, 1 insertions(+), 0 deletion(-)

Comments

Mika Westerberg March 23, 2021, 2:21 p.m. UTC | #1
On Tue, Mar 23, 2021 at 04:19:06PM +0300, Dan Carpenter wrote:
> We accidentally deleted this unlock on the error path.  Undelete it.
> 
> Fixes: 7f0a34d7900b ("thunderbolt: Decrease control channel timeout for software connection manager")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Julia also reported this yesterday and I was just about to send a patch
that fixes it too :) Applied this one now, thanks!

> ---
>  drivers/thunderbolt/domain.c | 1 +
>  1 files changed, 1 insertions(+), 0 deletion(-)
> 
> diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
> index a7d83eec3d15..98f4056f89ff 100644
> --- a/drivers/thunderbolt/domain.c
> +++ b/drivers/thunderbolt/domain.c
> @@ -493,6 +493,7 @@ int tb_domain_add(struct tb *tb)
>  	device_del(&tb->dev);
>  err_ctl_stop:
>  	tb_ctl_stop(tb->ctl);
> +	mutex_unlock(&tb->lock);
>  
>  	return ret;
>  }
diff mbox series

Patch

diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index a7d83eec3d15..98f4056f89ff 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -493,6 +493,7 @@  int tb_domain_add(struct tb *tb)
 	device_del(&tb->dev);
 err_ctl_stop:
 	tb_ctl_stop(tb->ctl);
+	mutex_unlock(&tb->lock);
 
 	return ret;
 }