|
@@ -89,6 +89,9 @@ int irq_bypass_register_producer(struct irq_bypass_producer *producer)
|
|
|
struct irq_bypass_producer *tmp;
|
|
|
struct irq_bypass_consumer *consumer;
|
|
|
|
|
|
+ if (!producer->token)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
might_sleep();
|
|
|
|
|
|
if (!try_module_get(THIS_MODULE))
|
|
@@ -136,6 +139,9 @@ void irq_bypass_unregister_producer(struct irq_bypass_producer *producer)
|
|
|
struct irq_bypass_producer *tmp;
|
|
|
struct irq_bypass_consumer *consumer;
|
|
|
|
|
|
+ if (!producer->token)
|
|
|
+ return;
|
|
|
+
|
|
|
might_sleep();
|
|
|
|
|
|
if (!try_module_get(THIS_MODULE))
|
|
@@ -177,7 +183,8 @@ int irq_bypass_register_consumer(struct irq_bypass_consumer *consumer)
|
|
|
struct irq_bypass_consumer *tmp;
|
|
|
struct irq_bypass_producer *producer;
|
|
|
|
|
|
- if (!consumer->add_producer || !consumer->del_producer)
|
|
|
+ if (!consumer->token ||
|
|
|
+ !consumer->add_producer || !consumer->del_producer)
|
|
|
return -EINVAL;
|
|
|
|
|
|
might_sleep();
|
|
@@ -227,6 +234,9 @@ void irq_bypass_unregister_consumer(struct irq_bypass_consumer *consumer)
|
|
|
struct irq_bypass_consumer *tmp;
|
|
|
struct irq_bypass_producer *producer;
|
|
|
|
|
|
+ if (!consumer->token)
|
|
|
+ return;
|
|
|
+
|
|
|
might_sleep();
|
|
|
|
|
|
if (!try_module_get(THIS_MODULE))
|