From patchwork Wed Aug 30 11:06:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 111301 Delivered-To: patch@linaro.org Received: by 10.140.95.112 with SMTP id h103csp743114qge; Wed, 30 Aug 2017 04:06:42 -0700 (PDT) X-Received: by 10.99.124.29 with SMTP id x29mr1138185pgc.191.1504091202472; Wed, 30 Aug 2017 04:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504091202; cv=none; d=google.com; s=arc-20160816; b=qb/jUrNeMl9pqBkZaHT0RwgbWo3wY6CdblaGJz8Kcbd5YwHEwZr1Ik1J7DdIrP7rCD 4JjNaa3ojbQDX1/rw9/oFqjo/bATjvN/hnJKSM4AiHOQWyrkSRdaduAVHrcCtcdonO7E r7DW9vg8vl4NFmLDzXZ/lFBpZX0zv9FN4Ti6cx/haU9rNUp0+qnsoV9+OyZ07CCkLjrA dQnnS9wiu79SupFGFTtVw+RwugZ782itT/sXU9JO89Qzx1GXn8KCGeK6PfZ1n2L1b7NE mfK1igNCjOFGQC9cZ1W6mHuRkdI+So2EZmTGx9worQX/MdeYDFJMpfMvIpNy1+fxUE8j ItRg== 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:arc-authentication-results; bh=S8yJFcLjm0PNLEwOkJuE7M8J/Jsvg9id2sJNfzpnsuA=; b=tluthendHWGRy7vpGKMeKUFbIBHnY2Ki7sCgZo8RNSl2JuP8jOtcM4h707s0ll3q7A Ln8HHcTDDQjz/AfQ1gG4S83aSHmOLZ2NL8qCxs3VF6IPlmq8FWpGlF2c04uaufZnRoDf 11bP5yq7Fuqr3E8h6R+yXIXTNkfZRc20NxxOHoxm9ts4dpMK+1WOdD0RPlKR8Evm15yI oiA+tye2rnKicIWo3MR93m2fyq2Z3ElvDGNZuIaKL6VtEOpyS5rGHECh/lina/EWddGi vYsoOa88YyjS0LUlMTv9Qhud8LFHvJIezV1cM5onaqtvEHXKq7cMY3ibd1O8rjsTvfZv oDQA== 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 l91si4303790plb.721.2017.08.30.04.06.42; Wed, 30 Aug 2017 04:06:42 -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 S1751390AbdH3LGi (ORCPT + 26 others); 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 Received: from 172.30.72.59 (EHLO DGGEMS408-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DGE67880; Wed, 30 Aug 2017 19:06:31 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.203.181.162) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.301.0; Wed, 30 Aug 2017 19:06:23 +0800 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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;