public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Abid Ali <dev.nuvorolabs@gmail•com>
To: Abid Ali <dev.nuvorolabs@gmail•com>
Cc: Dan Carpenter <dan.carpenter@linaro•org>,
	Russell King <linux@armlinux•org.uk>,
	Andrew Lunn <andrew@lunn•ch>,
	Heiner Kallweit <hkallweit1@gmail•com>,
	"David S . Miller" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
	netdev@vger•kernel.org, linux-kernel@vger•kernel.org
Subject: Re: [PATCH] net: phy: Fix premature resume by a PHY driver
Date: Mon, 21 Jul 2025 06:07:57 +0000	[thread overview]
Message-ID: <20250721060802.9030-1-dev.nuvorolabs@gmail.com> (raw)
In-Reply-To: <47495a5b-a3e5-44da-993d-5a7d3c19bd5c@suswa.mountain>

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.

      reply	other threads:[~2025-07-21  6:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18 15:42 [PATCH] net: phy: Fix premature resume by a PHY driver Abid Ali
2025-07-18 16:10 ` Russell King (Oracle)
2025-07-19  6:25   ` Abid Ali
2025-07-19  7:48     ` Russell King (Oracle)
2025-07-19 11:34       ` Abid Ali
2025-07-19 15:32         ` Russell King (Oracle)
2025-07-19  5:37 ` kernel test robot
2025-07-20 18:09 ` Dan Carpenter
2025-07-21  6:07   ` Abid Ali [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250721060802.9030-1-dev.nuvorolabs@gmail.com \
    --to=dev.nuvorolabs@gmail$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=dan.carpenter@linaro$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=hkallweit1@gmail$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox