gpu: vga_switcheroo, fix lock imbalance
Subsystems (3)
PATCH 1/5 gpu: vga_switcheroo, fix lock imbalance
From: Jiri Slaby <[email protected]>
Stanse found that one error path in vga_switcheroo_debugfs_write omits to unlock vgasr_mutex. Fix that.
Signed-off-by Jiri Slaby <[email protected]>
Cc Dave Airlie <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/gpu/vga/vga_switcheroo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/vga/vga_switcheroo.c renamed from drivers/gpu/vga/vga_switcheroo.c~gpu-vga_switcheroo-fix-lock-imbalance +4 -2
@@ -276,8 +276,10 @@ vga_switcheroo_debugfs_write(struct filemutex_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 ) {
_
------------------------------------------------------------------------------
--