From: Andrew Lunn Date: Thu, 18 Jan 2018 16:42:50 +0000 (+0100) Subject: net: dsa: mv88e6xxx: Free ATU/VTU irq only when there is chip irq X-Git-Tag: v5.15~9522^2~111^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae14cafc933b977f368ea7510d3b50b9ad5e1fc6;p=platform%2Fkernel%2Flinux-starfive.git net: dsa: mv88e6xxx: Free ATU/VTU irq only when there is chip irq We only register the ATU and VTU irq when we have a chip level IRQ. In the error path, we should only attempt to remove the ATU and VTU irq if we also have a chip level IRQ. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 54cb00a..eb328ba 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3999,9 +3999,11 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) out_mdio: mv88e6xxx_mdios_unregister(chip); out_g1_vtu_prob_irq: - mv88e6xxx_g1_vtu_prob_irq_free(chip); + if (chip->irq > 0) + mv88e6xxx_g1_vtu_prob_irq_free(chip); out_g1_atu_prob_irq: - mv88e6xxx_g1_atu_prob_irq_free(chip); + if (chip->irq > 0) + mv88e6xxx_g1_atu_prob_irq_free(chip); out_g2_irq: if (chip->info->g2_irqs > 0 && chip->irq > 0) mv88e6xxx_g2_irq_free(chip);