irq: Check if someone is overwriting the irq chip data
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.
Signed-off-by Holger Hans Peter Freyther <[email protected]>
--- kernel/irq/chip.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
kernel/irq/chip.c +4 -0
@@ -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