[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47495a5b-a3e5-44da-993d-5a7d3c19bd5c@suswa.mountain>
Date: Sun, 20 Jul 2025 21:09:19 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Abid Ali <dev.nuvorolabs@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Abid Ali <dev.nuvorolabs@...il.com>
Subject: Re: [PATCH] net: phy: Fix premature resume by a PHY driver
Hi Abid,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Abid-Ali/net-phy-Fix-premature-resume-by-a-PHY-driver/20250718-234858
base: 347e9f5043c89695b01e66b3ed111755afcf1911
patch link: https://lore.kernel.org/r/20250718-phy_resume-v1-1-9c6b59580bee%40gmail.com
patch subject: [PATCH] net: phy: Fix premature resume by a PHY driver
config: sparc-randconfig-r071-20250719 (https://download.01.org/0day-ci/archive/20250720/202507200229.iOChX4Rp-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 14.3.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202507200229.iOChX4Rp-lkp@intel.com/
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
9c2c2e62df3fa3 Andrew Lunn 2018-02-27 1842 int __phy_resume(struct phy_device *phydev)
481b5d938b4a60 Sebastian Hesselbarth 2013-12-13 1843 {
0bd199fd9c19aa Russell King (Oracle 2024-02-02 1844) const struct phy_driver *phydrv = phydev->drv;
8a8f8281e7e7a8 Heiner Kallweit 2020-03-26 1845 int ret;
481b5d938b4a60 Sebastian Hesselbarth 2013-12-13 1846
e6e918d4eb93f4 Heiner Kallweit 2021-01-06 1847 lockdep_assert_held(&phydev->lock);
f5e64032a799d4 Russell King 2017-12-12 1848
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 1850 return 0;
8a477a6fb6a336 Florian Fainelli 2015-01-26 1851
8a8f8281e7e7a8 Heiner Kallweit 2020-03-26 @1852 ret = phydrv->resume(phydev);
^^^^^^^^^^^^^^
Then this will crash.
8a8f8281e7e7a8 Heiner Kallweit 2020-03-26 1853 if (!ret)
8a477a6fb6a336 Florian Fainelli 2015-01-26 1854 phydev->suspended = false;
8a477a6fb6a336 Florian Fainelli 2015-01-26 1855
8a477a6fb6a336 Florian Fainelli 2015-01-26 1856 return ret;
481b5d938b4a60 Sebastian Hesselbarth 2013-12-13 1857 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists