]> Gentwo Git Trees - linux/.git/commit
net: dsa: microchip: common: Fix checks on irq_find_mapping()
authorBastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com>
Thu, 20 Nov 2025 09:12:00 +0000 (10:12 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 25 Nov 2025 11:32:41 +0000 (12:32 +0100)
commit7b3c09e1667977edee11de94a85e2593a7c15e87
tree857a6e49d832e38b80f7ed264dfbaf7bb5526137
parent7526183cfdbe352c51c285762f0e15b7c428ea06
net: dsa: microchip: common: Fix checks on irq_find_mapping()

irq_find_mapping() returns a positive IRQ number or 0 if no IRQ is found
but it never returns a negative value. However, on each
irq_find_mapping() call, we verify that the returned value isn't
negative.

Fix the irq_find_mapping() checks to enter error paths when 0 is
returned. Return -EINVAL in such cases.

CC: stable@vger.kernel.org
Fixes: c9cd961c0d43 ("net: dsa: microchip: lan937x: add interrupt support for port phy link")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com>
Link: https://patch.msgid.link/20251120-ksz-fix-v6-1-891f80ae7f8f@bootlin.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/microchip/ksz_common.c