Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp199991imj; Thu, 14 Feb 2019 18:32:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IYeN017QF/wjga9bdaDrS6Z5H9BBcrpc10nZtP59+bTF9zp4CUUZyLDAbGCA2x9DvbkY0nG X-Received: by 2002:a62:2fc3:: with SMTP id v186mr7412139pfv.82.1550197938917; Thu, 14 Feb 2019 18:32:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197938; cv=none; d=google.com; s=arc-20160816; b=0u0q82HPursrRgTkBn6sNFCkuG3uIDcTCUvhb8nKi9oLi1maeeeY5EgK2DB0wvASSn AZVE8ZUUHELMmoT6jU4Y5kAx9xrpuVRGmiUM9cHMPaPzE1I7T3oVloR3yinJ1IZiPtrg k13KM0OcUm/3TO4n3g3L9R93DPUbkL0Q1iYZgpJKR1wGy9uZKzoUG8ClcREADdxgwrkH 4uIk4YTOTHf+r4XcszXa0tnlZRErKB8psE/fsnxqKQv+aRz2vmteE2GkR+QLrDK5UpOQ eKYiKZkmPoer9BMPWJQggFrEV57QtPlpOkdhcwO7P2DbCTaf3GXwZva9ptkZodwLXH19 xD9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dQsiEhSinIuGMHEjzdLskgBM+2mae4u7Ov2SYmnFCuU=; b=tv8dYq3XDNWH8yo9XMjQ73SR5wD878mvcd3tGBqzWxcypTfbsFbcgy8Z2es+wE3kv0 Y18ivlDKCaB7J34GSYzfSHfuUxglfmWGx+9g8h3SbRgQdNqZbRqCosRBSs9mToORsf9x N4CsTCmbAq9vGpsctjI+5+n2+H/Rt2k8KLzkcSTpqXlueOWrEKVkPF7Fh2YagHK2E7MR dxCa5v6oGfiSmYAaLlnPqsmOXwNp6x831AfELK7NXxEgUwWRxduy8r0hNX+t+Fd3SR+E Li/8m80+eKWp045fs/RYl1MtiRtHCR/e6CxAu/8+MVFrQ02q/Ou6gvcYS3g83aC710Dl 2G/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FQUp3HYA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si4038417pgh.185.2019.02.14.18.32.03; Thu, 14 Feb 2019 18:32:18 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=FQUp3HYA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406176AbfBOCRH (ORCPT + 99 others); Thu, 14 Feb 2019 21:17:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:55580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392121AbfBOCQE (ORCPT ); Thu, 14 Feb 2019 21:16:04 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 750E821934; Fri, 15 Feb 2019 02:16:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196964; bh=i9CWBbz0n5OmiHfhDnmO88mOqULBnhlAm4Yrb4d8ugQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FQUp3HYAB2gdww5Lrrf8RYVRrIByaFresIUG4zdoSFHwNnoxW3rmG+FNvRRMG3Phm X1vMBC27OVsgpx018j9QiWPhYM12EJcUzaB5iM23d8u8bdo50uCgktp3K6t6U3VGRK tusqp/9dTIExdQ4g98m5fOWtD25UWsw5kXmuXTCU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Atsushi Nemoto , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 3.18 11/16] net: altera_tse: fix connect_local_phy error path Date: Thu, 14 Feb 2019 21:15:41 -0500 Message-Id: <20190215021546.179605-11-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215021546.179605-1-sashal@kernel.org> References: <20190215021546.179605-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Atsushi Nemoto [ Upstream commit 17b42a20d7ca59377788c6a2409e77569570cc10 ] The connect_local_phy should return NULL (not negative errno) on error, since its caller expects it. Signed-off-by: Atsushi Nemoto Acked-by: Thor Thayer Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/altera/altera_tse_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c index 2eb6404755b1..c1b599c52195 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -706,8 +706,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev) phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link, priv->phy_iface); - if (IS_ERR(phydev)) + if (IS_ERR(phydev)) { netdev_err(dev, "Could not attach to PHY\n"); + phydev = NULL; + } } else { int ret; -- 2.19.1