Skip to contentSkip to conversation

Videopix Frame Grabber: Fix unreleased lock in vfc_debug()

PATCH New Matthias Kaehlcke 1 participant 1 message Jul 1, 2007 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

drivers/sbus/char/vfc_dev.c +1 -0
index 6afc7e5..1cbdabd 100644
@@ -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;
 		}
Signature · 12 lines
Matthias Kaehlcke
Linux Application Developer
Barcelona


   Usually when people are sad, they don't do anything. They just cry over
     their condition. But when they get angry, they bring about a change
                              (Malcolm X)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-