* [PATCH] irq: Check if someone is overwriting the irq chip data
@ 2011-06-10 18:38 Holger Hans Peter Freyther
0 siblings, 0 replies; only message in thread
From: Holger Hans Peter Freyther @ 2011-06-10 18:38 UTC (permalink / raw)
To: linux-arm-kernel
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 <zecke@selfish.org>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-06-10 18:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 18:38 [PATCH] irq: Check if someone is overwriting the irq chip data Holger Hans Peter Freyther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).