2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 20:53:53 +08:00

[media] drxk: Does not unlock mutex if sanity check failed in scu_command()

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>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Alexey Khoroshilov 2012-04-05 18:53:20 -03:00 committed by Mauro Carvalho Chehab
parent 3626479e48
commit e4459e1682

View File

@ -1520,8 +1520,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);