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: <CAMuHMdV18H820-fkn61LKz5O6GAqL7GPa6vFM4v1GysX6cuV=A@mail.gmail.com>
Date:   Tue, 2 Jan 2018 08:52:27 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc:     netdev@...r.kernel.org,
        "open list:RENESAS ETHERNET DRIVERS" 
        <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH 1/2] ravb: kill redundant check in the probe() method

Hi Sergei,

On Sun, Dec 31, 2017 at 7:41 PM, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com> wrote:
> Browsing thru the driver diassembly, I noticed that gcc was  able to
> figure  out  that the 'ndev' pointer is always non-NULL when calling
> free_netdev()  on the probe() method's  error path and  thus skip that
> redundant NULL check... gcc is smart, be like gcc! :-)

Thanks for your patch!

> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>

> --- net-next.orig/drivers/net/ethernet/renesas/ravb_main.c
> +++ net-next/drivers/net/ethernet/renesas/ravb_main.c
> @@ -2205,8 +2205,7 @@ out_dma_free:
>         if (chip_id != RCAR_GEN2)
>                 ravb_ptp_stop(ndev);
>  out_release:
> -       if (ndev)
> -               free_netdev(ndev);
> +       free_netdev(ndev);
>
>         pm_runtime_put(&pdev->dev);
>         pm_runtime_disable(&pdev->dev);

BTW, there isn't a functional dependency, but you may want to move the
freeing of the netdev below disabling of Runtime PM for symmetry (use
reverse order in cleanup).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ