]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drxk: Does not unlock mutex if sanity check failed in scu_command()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Thu, 5 Apr 2012 21:53:20 +0000 (18:53 -0300)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 11 May 2012 12:13:57 +0000 (13:13 +0100)
commit e4459e1682c107d7ee1bf102c1ba534230e9b50b upstream.

If sanity check fails in scu_command(), goto error leads to unlock of
an unheld mutex. The check should not fail in reality, but it nevertheless
worth fixing.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/dvb/frontends/drxk_hard.c

index f6431ef827dc1f86e6b4748ae08c5edb141919ff..a1f5e3d73e6a138f393149514e0652a9648893d4 100644 (file)
@@ -1523,8 +1523,10 @@ static int scu_command(struct drxk_state *state,
        dprintk(1, "\n");
 
        if ((cmd == 0) || ((parameterLen > 0) && (parameter == NULL)) ||
-           ((resultLen > 0) && (result == NULL)))
-               goto error;
+           ((resultLen > 0) && (result == NULL))) {
+               printk(KERN_ERR "drxk: Error %d on %s\n", status, __func__);
+               return status;
+       }
 
        mutex_lock(&state->mutex);