Skip to contentSkip to conversation

thunderbolt: unlock on error path in tb_domain_add()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 23, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thunderbolt: unlock on error path in tb_domain_add()

We accidentally deleted this unlock on the error path. Undelete it.

Fixes 7f0a34d7900b ("thunderbolt: Decrease control channel timeout for software connection manager")
---
 drivers/thunderbolt/domain.c | 1 +
 1 files changed, 1 insertions(+), 0 deletion(-)
drivers/thunderbolt/domain.c +1 -0
index a7d83eec3d15..98f4056f89ff 100644
@@ -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;
 }

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#1 lore raw
Quoted 4 lines · Dan Carpenter

We accidentally deleted this unlock on the error path. Undelete it.

Fixes 7f0a34d7900b ("thunderbolt: Decrease control channel timeout for software connection manager")

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

Quoted 16 lines
---
 drivers/thunderbolt/domain.c | 1 +
 1 files changed, 1 insertions(+), 0 deletion(-)
drivers/thunderbolt/domain.c +1 -0
index a7d83eec3d15..98f4056f89ff 100644
@@ -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;
 }