* [patch] [media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl()
[not found] <50e3bfe0.IJT/Tw4ZVUbERlpE%fengguang.wu@intel.com>
@ 2013-01-04 18:56 ` Dan Carpenter
2013-01-07 12:04 ` Nikolaus Schulz
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-01-04 18:56 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Nikolaus Schulz, Michael Krufky, linux-media, kbuild,
kernel-janitors
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>
---
Only needed in linux-next.
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index 190e5e0..0aac309 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -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;
@@ -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;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] [media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl()
2013-01-04 18:56 ` [patch] [media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl() Dan Carpenter
@ 2013-01-07 12:04 ` Nikolaus Schulz
0 siblings, 0 replies; 2+ messages in thread
From: Nikolaus Schulz @ 2013-01-07 12:04 UTC (permalink / raw)
To: Dan Carpenter
Cc: Mauro Carvalho Chehab, Michael Krufky, linux-media, kbuild,
kernel-janitors
On Fri, Jan 04, 2013 at 09:56:02PM +0300, Dan Carpenter wrote:
> We recently pushed the locking down into this function, but there was
> an error path where the unlock was missed.
Ugh, indeed. Thanks for catching this!
Nikolaus.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-07 12:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <50e3bfe0.IJT/Tw4ZVUbERlpE%fengguang.wu@intel.com>
2013-01-04 18:56 ` [patch] [media] dvb: unlock on error in dvb_ca_en50221_io_do_ioctl() Dan Carpenter
2013-01-07 12:04 ` Nikolaus Schulz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox