From: Sergei Shtylyov Date: Sun, 31 Dec 2017 18:41:35 +0000 (+0300) Subject: ravb: kill redundant check in the probe() method X-Git-Tag: Ubuntu-5.2.0-15.16~5092^2~246^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5d0c100c228b51ce2c14bdbc845ca446e0494689;p=mirror_ubuntu-eoan-kernel.git ravb: kill redundant check in the probe() method Browsing thru the driver disassembly, 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! :-) Signed-off-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 009780df664b..c87f57ca4437 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/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);