[SPARC] Videopix Frame Grabber: Fix unreleased lock in vfc_debug()
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>
Tue, 31 Jul 2007 08:37:24 +0000 (01:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Jul 2007 08:37:24 +0000 (01:37 -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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
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;
                }