This is a note to let you know that I've just added the patch titled net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-phy-fixed_phy-fix-null-vs-is_err-checking-in-__f.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 818c9aa9da0404a2c39402486f8369462b84d392 Author: Miaoqian Lin <linmq006@xxxxxxxxx> Date: Fri Dec 24 02:14:59 2021 +0000 net: phy: fixed_phy: Fix NULL vs IS_ERR() checking in __fixed_phy_register [ Upstream commit b45396afa4177f2b1ddfeff7185da733fade1dc3 ] The fixed_phy_get_gpiod function() returns NULL, it doesn't return error pointers, using NULL checking to fix this.i Fixes: 5468e82f7034 ("net: phy: fixed-phy: Drop GPIO from fixed_phy_add()") Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx> Link: https://lore.kernel.org/r/20211224021500.10362-1-linmq006@xxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c index c65fb5f5d2dc5..a0c256bd54417 100644 --- a/drivers/net/phy/fixed_phy.c +++ b/drivers/net/phy/fixed_phy.c @@ -239,8 +239,8 @@ static struct phy_device *__fixed_phy_register(unsigned int irq, /* Check if we have a GPIO associated with this fixed phy */ if (!gpiod) { gpiod = fixed_phy_get_gpiod(np); - if (IS_ERR(gpiod)) - return ERR_CAST(gpiod); + if (!gpiod) + return ERR_PTR(-EINVAL); } /* Get the next available PHY address, up to PHY_MAX_ADDR */