Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4591992pja; Thu, 21 Nov 2019 22:27:49 -0800 (PST) X-Google-Smtp-Source: APXvYqy6vou33U4g/AkR9rGC05tHuY1ABEnqIgOH+1RR+otUD8j6vgum4kvXQCcdaCIinuBPbpv3 X-Received: by 2002:a17:906:c353:: with SMTP id ci19mr18670337ejb.249.1574404068978; Thu, 21 Nov 2019 22:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574404068; cv=none; d=google.com; s=arc-20160816; b=Uw8I3C5xkyp6OdHqMa2R2ynIws5H5DF9ffKzMjf1s3+VzzwWLjeLnlevl9LW7hamKm UXR3qZ3RHseD9EfvUlmIuZQzBMu6lI/5hfRqurjEOUdZ2JESK9ayzcZxTw58BGbB8w1c y6Rt3mGFd5P+c6fqUH6y5snmp9l5JLpXXGPJApw5cP18WwbenjeRCVCCANnF6NtwA++K aLmOA2ZZit/Q98trYdW5QKtGbu/89aNbm0q2OzS5ZYkUvtHMWzRtvVfkDttJli6TUZZO Pc8CS/6JP38NV37wqiaJza5akUh/GpRh3n/bF8QkHjARHg7q4yGrVCy7U6baE9JUSED4 B6zQ== 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=tcJ/y9yDofrOJ2Mgk1Wa0+TJE9vdNAouGJ3khSjeSxo=; b=CedMSzV+gwSHSnTnw1jdoWvM41foxeKdB95qhn6YC/mgSxv+8ILPl3+x4/a8tW8kJb Wglcp2L7WeyLvsXlkocPIfk/KojjaRjOLQqp6Mhk8yzIDf8q4zz0jQW9w33nzXvXZcBc Yk9EbEnkXeFnHSk2D/65LwRignT5SC8wbfDY/dEFFkUv2QuhZz2xQarYG5YHip9ShkZ7 v7tn7wUD7TLxckBe3DMeBfWDfnTkPYKMtX6B1SJDHdD6z7KgnIlBtKPYwgNOz7mAGWen O+/LITh7jzcN1W26p0sfNSPI4zKhDHJpnJkcJteTho1PIC9VIXzN6yqWdAR+qY331vTV DPfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zZrKmttk; 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 v20si1777859edc.69.2019.11.21.22.27.20; Thu, 21 Nov 2019 22:27:48 -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=zZrKmttk; 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 S1728883AbfKVGWv (ORCPT + 99 others); Fri, 22 Nov 2019 01:22:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:57234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728320AbfKVFvz (ORCPT ); Fri, 22 Nov 2019 00:51:55 -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 2330020726; Fri, 22 Nov 2019 05:51:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401914; bh=jQ1iFzeS+vCtqt56Z82AOL2Hls9N2/gLhDuxtgK3EXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zZrKmttk3iE92veqOw7VTislUPHAzwHN1eYolHCvyeP/zcuxkjf+31X0L2pF1KBYw AxceKufmmvpjpMxvMkNLQ42Xe7N/pv6GP5mKyeRY9jVrFEu5ydNLRuGCHk4ZzD+xZU ze0QVfwWfg+iG7sfF4KIBQavoETJRtw2DYofAMFQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kangjie Lu , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 145/219] net: (cpts) fix a missing check of clk_prepare Date: Fri, 22 Nov 2019 00:47:57 -0500 Message-Id: <20191122054911.1750-138-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review 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: Kangjie Lu [ Upstream commit 2d822f2dbab7f4c820f72eb8570aacf3f35855bd ] clk_prepare() could fail, so let's check its status, and if it fails, return its error code upstream. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/cpts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index b96b93c686bf1..4f644ac314fe8 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -572,7 +572,9 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs, return ERR_CAST(cpts->refclk); } - clk_prepare(cpts->refclk); + ret = clk_prepare(cpts->refclk); + if (ret) + return ERR_PTR(ret); cpts->cc.read = cpts_systim_read; cpts->cc.mask = CLOCKSOURCE_MASK(32); -- 2.20.1