summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorDaniel Scheller <d.scheller@gmx.net>2017-12-17 10:40:48 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-19 07:17:50 -0500
commitc0e10260cc6462cbfbcbfc35eb07e4f626704a4a (patch)
treef0a5951ace93d4139be911f044e16ad60740bd5a /drivers/media/pci
parentb7b9a5a93b7d859dacc3dff312346b4ab23fa60d (diff)
downloadlinux-c0e10260cc6462cbfbcbfc35eb07e4f626704a4a.tar.bz2
media: ddbridge: detach first input if the second one failed to init
In ddb_ports_attach(), if the second input of a dual tuner failed to initialise, the first one can be detached (and resources be freed) as this will be counted as the whole port having failed to initialise, thus the first one won't be used anyway. Signed-off-by: Daniel Scheller <d.scheller@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index e68ca00e73d8..d2e1c99a37ab 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1935,8 +1935,10 @@ static int ddb_port_attach(struct ddb_port *port)
if (ret < 0)
break;
ret = dvb_input_attach(port->input[1]);
- if (ret < 0)
+ if (ret < 0) {
+ dvb_input_detach(port->input[0]);
break;
+ }
port->input[0]->redi = port->input[0];
port->input[1]->redi = port->input[1];
break;