From: Vivien Didelot Date: Tue, 26 Sep 2017 18:57:21 +0000 (-0400) Subject: net: dsa: mv88e6xxx: lock mutex when freeing IRQs X-Git-Tag: v4.13.6~123 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c2d86cecc510ba347fa7fdee4c0292b2f3ced772;p=users%2Fdwmw2%2Flinux.git net: dsa: mv88e6xxx: lock mutex when freeing IRQs [ Upstream commit b32ca44a88def4bf92626d8777494c6f14638c42 ] mv88e6xxx_g2_irq_free locks the registers mutex, but not mv88e6xxx_g1_irq_free, which results in a stack trace from assert_reg_lock when unloading the mv88e6xxx module. Fix this. Fixes: 3460a5770ce9 ("net: dsa: mv88e6xxx: Mask g1 interrupts and free interrupt") Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 74e72fdea9a27..c75271c722a79 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -4019,7 +4019,9 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev) if (chip->irq > 0) { if (mv88e6xxx_has(chip, MV88E6XXX_FLAG_G2_INT)) mv88e6xxx_g2_irq_free(chip); + mutex_lock(&chip->reg_lock); mv88e6xxx_g1_irq_free(chip); + mutex_unlock(&chip->reg_lock); } }