[alsa-devel] [PATCH v3 20/21] media: media: dvb-frontend fix enable_source error legs
Shuah Khan
shuahkh at osg.samsung.com
Tue Sep 22 19:19:39 CEST 2015
When enable_source finds the tuner busy, do dvb_generic_release().
In addition, when dvb_frontend_start() fails, call disable_source
to release tuner.
Signed-off-by: Shuah Khan <shuahkh at osg.samsung.com>
---
drivers/media/dvb-core/dvb_frontend.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index c06dd61..67e30ae 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2503,13 +2503,13 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
if (ret) {
dev_err(fe->dvb->device,
"Tuner is busy. Error %d\n", ret);
- goto err1;
+ goto err2;
}
}
#endif
ret = dvb_frontend_start (fe);
if (ret)
- goto err2;
+ goto err3;
/* empty event queue */
fepriv->events.eventr = fepriv->events.eventw = 0;
@@ -2519,6 +2519,11 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
mutex_unlock (&adapter->mfe_lock);
return ret;
+err3:
+#ifdef CONFIG_MEDIA_CONTROLLER_DVB
+ if (fe->dvb->mdev && fe->dvb->mdev->disable_source)
+ fe->dvb->mdev->disable_source(dvbdev->entity);
+#endif
err2:
dvb_generic_release(inode, file);
err1:
--
2.1.4
More information about the Alsa-devel
mailing list