diff options
author | Alexey Khoroshilov | 2011-08-29 19:46:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2011-08-29 20:20:11 +0200 |
commit | 22f88fcf407933321d08c45520fbeffca70b05d1 (patch) | |
tree | 8f419f5ca814b09e95b7eaff8ea5d070946957e5 /drivers/staging/easycap/easycap_main.c | |
parent | staging: et131x: Use phy-device, mii_bus and ethtool_ops (diff) | |
download | kernel-qcow2-linux-22f88fcf407933321d08c45520fbeffca70b05d1.tar.gz kernel-qcow2-linux-22f88fcf407933321d08c45520fbeffca70b05d1.tar.xz kernel-qcow2-linux-22f88fcf407933321d08c45520fbeffca70b05d1.zip |
staging/easycap: fix mismatch in easycap_poll() mutex lock-unlock
In case if condition (kd != isdongle(peasycap)) becomes true,
easycap_poll() returns without releasing easycapdc60_dongle[kd].mutex_video.
The patch adds mutex_unlock() before that return.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/easycap/easycap_main.c')
-rw-r--r-- | drivers/staging/easycap/easycap_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/easycap/easycap_main.c b/drivers/staging/easycap/easycap_main.c index bea281624c41..3ea51c373914 100644 --- a/drivers/staging/easycap/easycap_main.c +++ b/drivers/staging/easycap/easycap_main.c @@ -953,8 +953,10 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait) * peasycap, IN WHICH CASE A REPEAT CALL TO isdongle() WILL FAIL. * IF NECESSARY, BAIL OUT. */ - if (kd != isdongle(peasycap)) + if (kd != isdongle(peasycap)) { + mutex_unlock(&easycapdc60_dongle[kd].mutex_video); return -ERESTARTSYS; + } if (!file) { SAY("ERROR: file is NULL\n"); mutex_unlock(&easycapdc60_dongle[kd].mutex_video); |