Received: by 10.192.165.156 with SMTP id m28csp696865imm; Thu, 19 Apr 2018 06:09:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4894CEQVTi2VYYnu1H7XYqJOS0cFNFXN4P3qSmTUCq1kAbFlCk6apKDTB8ghuDhtvy0xfqf X-Received: by 10.99.166.10 with SMTP id t10mr5214561pge.357.1524143392810; Thu, 19 Apr 2018 06:09:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524143392; cv=none; d=google.com; s=arc-20160816; b=KyUgD9R7imjskcCivRFWrXGfu5sR8UOkiF8U/nE19v/aXQibYFAS+I4yJwrbRCE+1Q 5jgcXVohHvX1Las9z6GQs5tf540l8UMqo2gIcRR+pxs03M9IVTjyTrDphd833ju6dcQj IgVyFJ2QHp68qQSyujQ9nuLGUo2mNzMWac0UgiUwdGhpRKbN829zyDuqtHP46ZxT8/nT z4+hbtFGju/N277teHogGDvTxzFQ5qQIx//Mqu2hcXyj1dI/HMcXr2+Ov88ZrnuN8BO8 fTzrk4k3bE82hqMjnYMuMP3nKtwt9g1edvJKdNHGMMfWVqGw6KGgv2+pFNWWD8vL9QO3 Yjww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date :arc-authentication-results; bh=n/+PUEfITPbUVqv4fM+yK15FmDoin6WA1kih7yYF+DU=; b=oQPlPrkeuuK6JmzuDsgCkCJ8uH8SQNDkxKBfRlN23nluV09qH7vo6SkvmhgwBm+Cf2 Ne/vPRux+1xVaUjy4W1ePIrQCIXURC9+FLsnownRfuLtKntf7YOuDsy+pnKsq3MhspAP ZRKa0BmxbDD7crPBzN5CnpxnIqmBNVkxHbxjL5VaSvqUhTvdM0ic7t7i1BUcvNANWwiW P1MDWOdGdXEk30kTDEYmD8RkUkO0wEjCpkmCpx9aL18E3mh81msAS01BBv+EWeCgYxQA qIVxfDZaSLfYwSAbYjntrRwev59/aHAUSOu7/u7GhNwFhiqanMmaQyn/t0qpEEsfaD8K yxGQ== 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 s72si3258385pfa.252.2018.04.19.06.09.38; Thu, 19 Apr 2018 06:09:52 -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 S1752844AbeDSNH5 (ORCPT + 99 others); Thu, 19 Apr 2018 09:07:57 -0400 Received: from agrajag.zerfleddert.de ([88.198.237.222]:55498 "EHLO agrajag.zerfleddert.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbeDSNHz (ORCPT ); Thu, 19 Apr 2018 09:07:55 -0400 X-Greylist: delayed 326 seconds by postgrey-1.27 at vger.kernel.org; Thu, 19 Apr 2018 09:07:55 EDT Received: by agrajag.zerfleddert.de (Postfix, from userid 1000) id BA0215B202E2; Thu, 19 Apr 2018 15:02:28 +0200 (CEST) Date: Thu, 19 Apr 2018 15:02:28 +0200 From: Stefan Potyra To: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ldv-project@linuxtesting.org, sil2review@lists.osadl.org Subject: [PATCH] Check for an error when the clock is enabled. Message-ID: <20180419130228.rdee6hwsjcui5py7@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Found by Linux Driver Verification project (linuxtesting.org). Fixes: 0814e8d5da2b sc16is7xx: enable the clock Signed-off-by: Stefan Potyra --- drivers/tty/serial/sc16is7xx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 65792a3539d0..243c96025053 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1168,7 +1168,10 @@ static int sc16is7xx_probe(struct device *dev, else return PTR_ERR(s->clk); } else { - clk_prepare_enable(s->clk); + ret = clk_prepare_enable(s->clk); + if (ret) + return ret; + freq = clk_get_rate(s->clk); } -- 2.17.0