[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250721060802.9030-1-dev.nuvorolabs@gmail.com>
Date: Mon, 21 Jul 2025 06:07:57 +0000
From: Abid Ali <dev.nuvorolabs@...il.com>
To: Abid Ali <dev.nuvorolabs@...il.com>
Cc: Dan Carpenter <dan.carpenter@...aro.org>,
Russell King <linux@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: phy: Fix premature resume by a PHY driver
Hi Dan,
On Sun, Jul 20, 2025 at 21:09:19 +0300, Dan Carpenter wrote:
> smatch warnings:
> drivers/net/phy/phy_device.c:1852 __phy_resume() error: we previously assumed 'phydrv->resume' could be null (see line 1849)
>
> vim +1852 drivers/net/phy/phy_device.c
>
> 9421d84b1b3e16 Abid Ali 2025-07-18 @1849 if (!phydrv || !phydrv->resume && phydev->suspended)
> ^^^^^^^^^^^^^^^
> This checks for if the resume pointer is NULL, but if the resume is
> NULL but suspend is also NULL. I'm surprised that the compiler allows
> us to write that comparison without adding parenthesis. I thought that
> it would complain about && having higher precedence.
>
> 8a8f8281e7e7a8 Heiner Kallweit 2020-03-26 @1852 ret = phydrv->resume(phydev);
> ^^^^^^^^^^^^^^
> Then this will crash.
yea, there is an obvious error here and have pointed it in the thread.
I have not gone forward with the V2 for now as we there are other concerns
thats not easy to address.
LINK: https://lore.kernel.org/netdev/aHu6kzOpaoDFR8BM@shell.armlinux.org.uk/
For now the idea is to deal with issue pointed in the commit in the driver`s
resume callback itself.
Powered by blists - more mailing lists