soundwire: irq: Invalidate slave->irq before disposing the mapping
PATCH 1/1 soundwire: irq: Invalidate slave->irq before disposing the mapping
In sdw_irq_dispose_mapping() invalidate the value in slave->irq before calling irq_dispose_mapping().
This fixes the potential problem with the original code that slave->irq was left with the value of the disposed mapping, so it looked like it was still a valid IRQ.
Fixes a5fef9baa87f ("soundwire: bus: Move irq mapping cleanup into devres")
Signed-off-by Richard Fitzgerald <[email protected]>
--- drivers/soundwire/irq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/soundwire/irq.c +5 -1
@@ -49,8 +49,12 @@ void sdw_irq_delete(struct sdw_bus *bus)static void sdw_irq_dispose_mapping (void *data) {struct sdw_slave *slave = data; +int irq = slave->irq; -irq_dispose_mapping (slave->irq); + slave->irq =0 ; + +if (irq) +irq_dispose_mapping (irq); }void sdw_irq_create_mapping (struct sdw_slave *slave)
Signature · 1 line
2.47.3
Quoted 6 lines · Richard Fitzgerald
In
sdw_irq_dispose_mapping()invalidate the value inslave->irqbefore callingirq_dispose_mapping().This fixes the potential problem with the original code that
slave->irqwas left with the value of the disposed mapping, so it looked like it was still a valid IRQ.
Actually, ignore this patch.
There are more problems with the validity of slave->irq and this isn't really tackling it fully.