Skip to content

Commit

Permalink
gpu: vga_switcheroo, fix lock imbalance
Browse files Browse the repository at this point in the history
Stanse found that one error path in vga_switcheroo_debugfs_write omits to
unlock vgasr_mutex.  Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Jiri Slaby authored and Dave Airlie committed Apr 28, 2010
1 parent 404b017 commit 8c88e50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/vga/vga_switcheroo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8c88e50

Please sign in to comment.