Skip to content

Commit

Permalink
[media] drxk: Does not unlock mutex if sanity check failed in scu_com…
Browse files Browse the repository at this point in the history
…mand()

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>
  • Loading branch information
Alexey Khoroshilov authored and Mauro Carvalho Chehab committed Apr 18, 2012
1 parent 3626479 commit e4459e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/dvb/frontends/drxk_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e4459e1

Please sign in to comment.