Skip to contentSkip to conversation

irq: Check if someone is overwriting the irq chip data

PATCH New Holger Hans Peter Freyther 1 participant 1 message Jun 10, 2011 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irq: Check if someone is overwriting the irq chip data

This tries to establish the semantic that one can either set the chip data to NULL or if it is NULL to some value but never overwrite a non NULL value.

---
 kernel/irq/chip.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
kernel/irq/chip.c +4 -0
index d5a3009..25e446d 100644
@@ -123,6 +123,10 @@ int irq_set_chip_data(unsigned int irq, void *data)
 
 	if (!desc)
 		return -EINVAL;
+
+	BUG_ON(data && desc->irq_data.chip_data &&
+		data != desc->irq_data.chip_data);
+
 	desc->irq_data.chip_data = data;
 	irq_put_desc_unlock(desc, flags);
 	return 0;
Signature · 1 line
1.7.4.1