summaryrefslogtreecommitdiff
path: root/drivers/irqchip/irq-bcm7120-l2.c
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2021-03-19 12:18:23 +0100
committerThomas Gleixner <tglx@linutronix.de>2021-03-19 22:52:11 +0100
commitc93a5e20c3c2dabef8ea360a3d3f18c6f68233ab (patch)
treea78ef5e9dcd8515fb89af8deb65f03c0f4f0df78 /drivers/irqchip/irq-bcm7120-l2.c
parent2c6b02185cc608c19a22691fadc6ca2cd114c286 (diff)
genirq/matrix: Prevent allocation counter corruption
When irq_matrix_free() is called for an unallocated vector the managed_allocated and total_allocated counters get out of sync with the real state of the matrix. Later, when the last interrupt is freed, these counters will underflow resulting in UINTMAX because the counters are unsigned. While this is certainly a problem of the calling code, this can be catched in the allocator by checking the allocation bit for the to be freed vector which simplifies debugging. An example of the problem described above: https://lore.kernel.org/lkml/20210318192819.636943062@linutronix.de/ Add the missing sanity check and emit a warning when it triggers. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20210319111823.1105248-1-vkuznets@redhat.com
Diffstat (limited to 'drivers/irqchip/irq-bcm7120-l2.c')
0 files changed, 0 insertions, 0 deletions