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;