Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl()

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>

authored by

Dan Carpenter and committed by
Mauro Carvalho Chehab
c4fe29a3 9898df64

+5 -2
+5 -2
drivers/media/dvb-core/dvb_ca_en50221.c
··· 1227 1227 case CA_GET_SLOT_INFO: { 1228 1228 struct ca_slot_info *info = parg; 1229 1229 1230 - if ((info->num > ca->slot_count) || (info->num < 0)) 1231 - return -EINVAL; 1230 + if ((info->num > ca->slot_count) || (info->num < 0)) { 1231 + err = -EINVAL; 1232 + goto out_unlock; 1233 + } 1232 1234 1233 1235 info->type = CA_CI_LINK; 1234 1236 info->flags = 0; ··· 1249 1247 break; 1250 1248 } 1251 1249 1250 + out_unlock: 1252 1251 mutex_unlock(&ca->ioctl_mutex); 1253 1252 return err; 1254 1253 }