DORMANTno replies

[PATCH] irq: Check if someone is overwriting the irq chip data

From: Holger Hans Peter Freyther <hidden>
Date: 2011-06-10 18:38:43
Subsystem: irq subsystem, the rest · Maintainers: Thomas Gleixner, Linus Torvalds

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.

Signed-off-by: Holger Hans Peter Freyther <redacted>
---
 kernel/irq/chip.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index d5a3009..25e446d 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -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;
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help