Skip to contentSkip to conversation

GPU: vga_switcheroo, fix lock imbalance

PATCH New Jiri Slaby 1 participant 1 message Mar 16, 2010

Subsystems (3)
lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 GPU: vga_switcheroo, fix lock imbalance

Stanse found that one error path in vga_switcheroo_debugfs_write omits to unlock vgasr_mutex. Fix that.

---
 drivers/gpu/vga/vga_switcheroo.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/vga/vga_switcheroo.c +4 -2
index d6d1149..c8768f3 100644
@@ -276,8 +276,10 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 
 	mutex_lock(&vgasr_mutex);
 
-	if (!vgasr_priv.active)
-		return -EINVAL;
+	if (!vgasr_priv.active) {
+		cnt = -EINVAL;
+		goto out;
+	}
 
 	/* pwr off the device not in use */
 	if (strncmp(usercmd, "OFF", 3) == 0) {
Signature · 1 line
1.7.0.1