We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6efb943 commit e44b49fCopy full SHA for e44b49f
virt/lib/irqbypass.c
@@ -40,21 +40,17 @@ static int __connect(struct irq_bypass_producer *prod,
40
if (prod->add_consumer)
41
ret = prod->add_consumer(prod, cons);
42
43
- if (ret)
44
- goto err_add_consumer;
45
-
46
- ret = cons->add_producer(cons, prod);
47
48
- goto err_add_producer;
+ if (!ret) {
+ ret = cons->add_producer(cons, prod);
+ if (ret && prod->del_consumer)
+ prod->del_consumer(prod, cons);
+ }
49
50
if (cons->start)
51
cons->start(cons);
52
if (prod->start)
53
prod->start(prod);
54
-err_add_producer:
55
- if (prod->del_consumer)
56
- prod->del_consumer(prod, cons);
57
-err_add_consumer:
+
58
return ret;
59
}
60
0 commit comments