Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751388AbdH3LGi (ORCPT ); Wed, 30 Aug 2017 07:06:38 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5495 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbdH3LGg (ORCPT ); Wed, 30 Aug 2017 07:06:36 -0400 From: Salil Mehta To: CC: , , , , , Subject: [PATCH net-next] net: hns3: Fixes the wrong IS_ERR check on the returned phydev value Date: Wed, 30 Aug 2017 12:06:03 +0100 Message-ID: <20170830110603.12372-1-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.203.181.162] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.59A69C39.016F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1ac1ed7805995f8af4a87afb11d48762 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1058 Lines: 28 This patch removes the wrong check being done for the phy device being returned by the mdiobus_get_phy() function. This function never returns the error pointers. Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet Driver for hip08 SoC") Reported-by: Dan Carpenter Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c index a2add8b..f32d719 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c @@ -150,7 +150,7 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev) } phydev = mdiobus_get_phy(mdio_bus, mac->phy_addr); - if (!phydev || IS_ERR(phydev)) { + if (!phydev) { dev_err(mdio_bus->parent, "Failed to get phy device\n"); mdiobus_unregister(mdio_bus); return -EIO; -- 2.7.4