From patchwork Thu Jan 2 22:07:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43CFCC3276C for ; Thu, 2 Jan 2020 22:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1711E21D7D for ; Thu, 2 Jan 2020 22:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004662; bh=DlMgruxUavY/yDjUbcfaObemlMrERpWGQGiTZD65ZEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TjHwIbeYYQx0Y5hXTY1mTNRkqJXnYcs1PREOs4EnuxT3hivb53dVVtjTY8OczmzPp 20zsxjVEvbznWwTUpq02qJJbYwGLGdGLb6IiAZ81k0j2h+wFYPJDrfZhw/nKiG9w1f dsrpNZP7+346q/eqtBFh+sELI60QuQWkGnr2e52w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731111AbgABWhl (ORCPT ); Thu, 2 Jan 2020 17:37:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:50364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731107AbgABWhi (ORCPT ); Thu, 2 Jan 2020 17:37:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 356BE20866; Thu, 2 Jan 2020 22:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004657; bh=DlMgruxUavY/yDjUbcfaObemlMrERpWGQGiTZD65ZEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vIhRJOgCCV2RicTrPsxCam32ucO6Bn+WCwLGK7W6JFea9mhcx5/HGL/C4/BkO4GMD yBq4Qhih085CGl9H+ok+fJpuLSOBfk2KzMbnXigwicBETKjnz6kikXhDg5GmEmjbBE elHckpRtDK7zfGQjHTTM7XDI9CnTXn/tNzrAe+eA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Daniel Lezcano , Sasha Levin Subject: [PATCH 4.4 099/137] clocksource/drivers/asm9260: Add a check for of_clk_get Date: Thu, 2 Jan 2020 23:07:52 +0100 Message-Id: <20200102220600.371316602@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chuhong Yuan [ Upstream commit 6e001f6a4cc73cd06fc7b8c633bc4906c33dd8ad ] asm9260_timer_init misses a check for of_clk_get. Add a check for it and print errors like other clocksource drivers. Signed-off-by: Chuhong Yuan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20191016124330.22211-1-hslester96@gmail.com Signed-off-by: Sasha Levin --- drivers/clocksource/asm9260_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clocksource/asm9260_timer.c b/drivers/clocksource/asm9260_timer.c index 217438d39eb3..38a28240f84f 100644 --- a/drivers/clocksource/asm9260_timer.c +++ b/drivers/clocksource/asm9260_timer.c @@ -196,6 +196,10 @@ static void __init asm9260_timer_init(struct device_node *np) panic("%s: unable to map resource", np->name); clk = of_clk_get(np, 0); + if (IS_ERR(clk)) { + pr_err("Failed to get clk!\n"); + return PTR_ERR(clk); + } ret = clk_prepare_enable(clk); if (ret)