lkml.org 
[lkml]   [2010]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] GPU: vga_switcheroo, fix lock imbalance
Date
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>
Cc: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/vga/vga_switcheroo.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index d6d1149..c8768f3 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -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) {
--
1.7.0.1



\
 
 \ /
  Last update: 2010-03-16 15:49    [W:0.022 / U:0.036 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site