Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp206274imj; Thu, 14 Feb 2019 18:40:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IZDqNhW4yXH/nFAVqg3mO9J5vvtmRi6+Rv/89vFggWxlhcGPgzOhe4lGV+iVORE2Ce5hE/M X-Received: by 2002:a62:2f06:: with SMTP id v6mr7580071pfv.216.1550198445664; Thu, 14 Feb 2019 18:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198445; cv=none; d=google.com; s=arc-20160816; b=VV4u7HvRy4FP4Z//3Xzzw5Bq7JpStxB96xtZstNV0kS4JPO8SqiwpHnwTSI/m3xgjL SHlAU5Q704D9MeUUifP3kOvIvH8nMujq8CS5BQxWIsWF6k+RJsh5e2btv9MS/4F4dYsi rPa+8Jan2pEoCyrMkh+lK9XH1pkTycNVkWKMt7Ne30Lp5ouXWZo8lfVI5ME3m+NTHPVK yT7P8I6cvDytEBJiBHgUn1Xsoqcgk6eX+pIQo17XvJpNGI9YA62pBWpJTR/CRjALq02g LBMnMlaEU0v2N7r932OzGp6HWUXuj3FIGePLaUCRm/rPKShHBH2ueCxjgCkcF84K/bcf BpdQ== 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=0zMjSOWvE+iDIxztMXQRFye3d6n/v0jT4RMHpy2t/G8=; b=pJTaw5vE1jNGr5bConlfUTI8UasuOIHpmQxOaWoxQsG+p5k+zfPdu2Ku0ieOeR/Fec FdfVXKcdIt9m/LuWnZ2gZ4yE56D2VrvL562DIRLoPpqV1U098UNccZWAD79u3OuV+6EE kGJ6nnrfERH51IvEXFWNjFSeen2w3PIOd9RfJKb08nmlO42pi6bke7yvuPmMeuWJ020o PfbniMhcvfBRw++Cs0ql14Um7c+I2B/Rw0wrT2INsUSv0q3JDwhj2XzdtbB9yUfmQ1it NefDY7JDvgp981ho/MIvKYMOJYwKt3QQlySTgVcIwxqeivwxMtiP8srKBFFa9xSGaylK 96kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=koeCxxOb; 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 j9si4080099pll.437.2019.02.14.18.40.29; Thu, 14 Feb 2019 18:40:45 -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=koeCxxOb; 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 S1729366AbfBOCiK (ORCPT + 99 others); Thu, 14 Feb 2019 21:38:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:50640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390391AbfBOCK2 (ORCPT ); Thu, 14 Feb 2019 21:10:28 -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 5B4DC222C9; Fri, 15 Feb 2019 02:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196628; bh=3+zc/19LEFGbhWKSdxv612tntjsURDSSB650hkgAfqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=koeCxxObGTxx3xPrIMVqnA+fp6UHaFz10MSt9C5GC0cubNh3amZ1w4Jb/KbFBmzan hvVu+hQbxJoeQN+7pRlvyQp5pvSOcw0QMjkbu5801rkDuqTkLiNfgoqzMVfPQ0Sz0e GvCgBIRLAS7BBp37PxS1L+2zYgps9RUyXD/XFXa8= 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 4.20 54/77] net: altera_tse: fix connect_local_phy error path Date: Thu, 14 Feb 2019 21:08:32 -0500 Message-Id: <20190215020855.176727-54-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215020855.176727-1-sashal@kernel.org> References: <20190215020855.176727-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 02921d877c08..aa1d1f5339d2 100644 --- a/drivers/net/ethernet/altera/altera_tse_main.c +++ b/drivers/net/ethernet/altera/altera_tse_main.c @@ -714,8 +714,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