lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160926231041.41091069.albert.aribaud@3adev.fr>
Date:   Mon, 26 Sep 2016 23:10:41 +0200
From:   Albert ARIBAUD <albert.aribaud@...ev.fr>
To:     Fabio Estevam <festevam@...il.com>
Cc:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Jiri Kosina <trivial@...nel.org>,
        Fugang Duan <fugang.duan@....com>
Subject: Re: [PATCH] net: trivial: fix fsl fec_main mdio write return value

Hi Fabio,

You are correct -- I'd rebased my patch as part of a series, and I did
not notice that the fix was already there. Apologies and thanks for
pointing it out.

Le Mon, 26 Sep 2016 18:00:32 -0300, Fabio Estevam <festevam@...il.com>
a écrit :

> Hi Albert,
> 
> On Mon, Sep 26, 2016 at 4:11 PM, Albert ARIBAUD (3ADEV)
> <albert.aribaud@...ev.fr> wrote:
> > If the MDIO enf-of-transfer wait loop does not time out,
> > 0 should be returned to the caller through ret, but ret
> > was not reset to 0 after receiving the return value of
> > pm_runtime_get_sync(). Reset ret when no time out occurred.Is this really needed?  
> 
> Commit 42ea4457 ("net: fec: normalize return value of
> pm_runtime_get_sync() in MDIO write") does the following:
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 91925e3..6cc3340 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1816,11 +1816,13 @@ static int fec_enet_mdio_write(struct mii_bus
> *bus, int mii_id, int regnum,
>         struct fec_enet_private *fep = bus->priv;
>         struct device *dev = &fep->pdev->dev;
>         unsigned long time_left;
> -       int ret = 0;
> +       int ret;
> 
>         ret = pm_runtime_get_sync(dev);
>         if (ret < 0)
>                 return ret;
> +       else
> +               ret = 0;
> 
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > b/drivers/net/ethernet/freescale/fec_main.c index 01f7e81..0413c05
> > 100644 --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -1818,6 +1818,8 @@ static int fec_enet_mdio_write(struct mii_bus
> > *bus, int mii_id, int regnum, netdev_err(fep->netdev, "MDIO write
> > timeout\n"); ret  = -ETIMEDOUT;
> >         }
> > +       else
> > +               ret = 0;  
> 
> , so is this really needed? ret should be 0 at this point.



Cordialement,
Albert ARIBAUD
3ADEV

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ