diff mbox

[1/5] gpu: vga_switcheroo, fix lock imbalance

Message ID 201004272111.o3RLB3j1019952@imap1.linux-foundation.org (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Morton April 27, 2010, 9:11 p.m. UTC
None
diff mbox

Patch

diff -puN drivers/gpu/vga/vga_switcheroo.c~gpu-vga_switcheroo-fix-lock-imbalance drivers/gpu/vga/vga_switcheroo.c
--- a/drivers/gpu/vga/vga_switcheroo.c~gpu-vga_switcheroo-fix-lock-imbalance
+++ a/drivers/gpu/vga/vga_switcheroo.c
@@ -276,8 +276,10 @@  vga_switcheroo_debugfs_write(struct file
 
 	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) {