From 5d0c100c228b51ce2c14bdbc845ca446e0494689 Mon Sep 17 00:00:00 2001 From: Sergei Shtylyov Date: Sun, 31 Dec 2017 21:41:35 +0300 Subject: [PATCH] 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 --- drivers/net/ethernet/renesas/ravb_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); -- 2.39.5