Videopix Frame Grabber: Fix unreleased lock in vfc_debug()
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Tue, 31 Jul 2007 07:39:23 +0000 (00:39 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 31 Jul 2007 22:39:43 +0000 (15:39 -0700)
Videopix Frame Grabber: vfc_debug() doesn't release the device lock
when copy_from_user() fails

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/sbus/char/vfc_dev.c

index 26b1d2a17ed2f9f3c15bb03d89d8f2e0739fa60c..9269f7fbd36364957f0cdc97a90357f4e987fd1f 100644 (file)
@@ -248,6 +248,7 @@ static int vfc_debug(struct vfc_dev *dev, int cmd, void __user *argp)
                                        buffer,inout.len);
 
                if (copy_to_user(argp,&inout,sizeof(inout))) {
+                       vfc_unlock_device(dev);
                        kfree(buffer);
                        return -EFAULT;
                }