Skip to content

Commit

Permalink
[media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl()
Browse files Browse the repository at this point in the history
We recently pushed the locking down into this function, but there was
an error path where the unlock was missed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed Jan 6, 2013
1 parent 9898df6 commit c4fe29a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/media/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,10 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
case CA_GET_SLOT_INFO: {
struct ca_slot_info *info = parg;

if ((info->num > ca->slot_count) || (info->num < 0))
return -EINVAL;
if ((info->num > ca->slot_count) || (info->num < 0)) {
err = -EINVAL;
goto out_unlock;
}

info->type = CA_CI_LINK;
info->flags = 0;
Expand All @@ -1247,6 +1249,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
break;
}

out_unlock:
mutex_unlock(&ca->ioctl_mutex);
return err;
}
Expand Down

0 comments on commit c4fe29a

Please sign in to comment.