Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2941954imm; Sun, 16 Sep 2018 06:26:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZL2xxdEVc6IPwZdX0cucG7lhzhpYm9m+A7op4Sjs1bFv1EKKlgaE9TWmdk0OOH5IqeY/yW X-Received: by 2002:a17:902:7803:: with SMTP id p3-v6mr20716254pll.119.1537104394223; Sun, 16 Sep 2018 06:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537104394; cv=none; d=google.com; s=arc-20160816; b=MW3JO2+fq+f1xgOdinOMrrUUTHcSzwcUDKhiHG/+QPMYb+RmK5rD0NetF5X0J9L+s4 uDWnwAWYqhHXIhCg1CxP5imM07YhKxVOQb0xmMrb03+5Z+KJUrUrR9vPimwp8zN1H54U qnn28SRn1PcQd2KKkFY7boreKxIEGDzWgSULc9blkvsF4/uz+n91avXvt/pfM83TBJ4j f5sfIn2FYR1fw0/L/HvD3dZmwjTR/refdz+OV+nllgOSJ88yAaVNsbm2uHYIsMTgQPcn mcJO1tINJQvaVFMfXFJ6q31tsq9k7rPrUYW2MDwOgbWUXbzO5kiN9EuAomzVa9+9Cq7G 87IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=3WWT/wkGXV8VP/NZ8aCTCkYwi+85BkOQS6HtFKPeLEU=; b=TM+Ubs73JZC5I56C0Zv8VBTOX9RAs5KXb9iFNra1jYz3urxGsOjpqzEZOHCQFHNSPH Ld8j/3aoRU9qaJr7XykqAteSh/Rk0sV2H5X6rUryh9uaJOZd3RRlTenZEGGONXg5bheD L6qZAXvLKGwXCzWnSGY/XfXmBwAM9PwFXw3yFl/+nJgj8EXAtuA6b9IYhnXFQH7DC/iJ gQEuN/E+ozjjvPmLm2OsfPme8fRe8DheJ/aqS6NdU1rLNMhw9rHSoL4kH38Ua7+KW+Mk x4VLbC6aq4q2EqgvyqQil8R9lBT4oCMR6DxMyILZkZHYy24hSt4M1g+ylricjA8414Ck y9dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5-v6si11870802plv.304.2018.09.16.06.26.19; Sun, 16 Sep 2018 06:26:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728417AbeIPStB (ORCPT + 99 others); Sun, 16 Sep 2018 14:49:01 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12155 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728350AbeIPStB (ORCPT ); Sun, 16 Sep 2018 14:49:01 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 662ADA10596CD; Sun, 16 Sep 2018 21:25:59 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.399.0; Sun, 16 Sep 2018 21:26:00 +0800 From: zhong jiang To: CC: , , Subject: [PATCH] net: ethernet: remove redundant null pointer check before of_node_put Date: Sun, 16 Sep 2018 21:13:42 +0800 Message-ID: <1537103622-63482-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_node_put has taken the null pinter check into account. So it is safe to remove the duplicated check before of_node_put. Signed-off-by: zhong jiang --- drivers/net/ethernet/freescale/fec_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 2708297..67d6c9d 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2055,8 +2055,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) node = of_get_child_by_name(pdev->dev.of_node, "mdio"); err = of_mdiobus_register(fep->mii_bus, node); - if (node) - of_node_put(node); + of_node_put(node); if (err) goto err_out_free_mdiobus; -- 1.7.12.4