Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: cgel.zte@gmail.com
Cc: f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com,
	hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Lv Ruyi <lv.ruyi@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] net: phy: fix error check return value of phy_read()
Date: Tue, 19 Apr 2022 14:07:59 +0200	[thread overview]
Message-ID: <Yl6mH0HKCGPxgejI@lunn.ch> (raw)
In-Reply-To: <20220419014439.2561835-1-lv.ruyi@zte.com.cn>

On Tue, Apr 19, 2022 at 01:44:39AM +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
> 
> phy_read() returns a negative number if there's an error, but the
> error-checking code in the bcm87xx driver's config_intr function
> triggers if phy_read() returns non-zero.  Correct that.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
> ---
>  drivers/net/phy/bcm87xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/bcm87xx.c b/drivers/net/phy/bcm87xx.c
> index 313563482690..e62b53718010 100644
> --- a/drivers/net/phy/bcm87xx.c
> +++ b/drivers/net/phy/bcm87xx.c
> @@ -146,7 +146,7 @@ static int bcm87xx_config_intr(struct phy_device *phydev)
>  
>  	if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
>  		err = phy_read(phydev, BCM87XX_LASI_STATUS);
> -		if (err)
> +		if (err < 0)
>  			return err;

This should probably have a Fixes: tag, and be for net, not next-next.
Please read the netdev FAQ about the trees, and submittinng fixes for
netdev.

     Andrew

  reply	other threads:[~2022-04-19 12:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  1:44 [PATCH] net: phy: fix error check return value of phy_read() cgel.zte
2022-04-19 12:07 ` Andrew Lunn [this message]
2022-04-25 15:55   ` Florian Fainelli

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=Yl6mH0HKCGPxgejI@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=cgel.zte@gmail.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lv.ruyi@zte.com.cn \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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