From: Matthias Kaehlcke Date: Tue, 31 Jul 2007 07:39:23 +0000 (-0700) Subject: Videopix Frame Grabber: Fix unreleased lock in vfc_debug() X-Git-Tag: v2.6.23-rc2~47 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e48591700f7df5969e17b0a41b7dde011c6810c;p=linux-2.6 Videopix Frame Grabber: Fix unreleased lock in vfc_debug() Videopix Frame Grabber: vfc_debug() doesn't release the device lock when copy_from_user() fails Signed-off-by: Matthias Kaehlcke Acked-by: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 26b1d2a17e..9269f7fbd3 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c @@ -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; }