From patchwork Sat Dec 14 22:35:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11292539 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5A68E14B7 for ; Sat, 14 Dec 2019 22:35:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B81A214AF for ; Sat, 14 Dec 2019 22:35:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="pxfJyM/s" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbfLNWfI (ORCPT ); Sat, 14 Dec 2019 17:35:08 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:47642 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbfLNWfI (ORCPT ); Sat, 14 Dec 2019 17:35:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1576362907; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=D8vcvAXh5n4Ipif6aaOi/DGeJKxBOvkvdh2wheOB+JI=; b=pxfJyM/sjHPouXV1XzvvqPmfTYqZI4FDkQ1OTxSXW4DRzNRYzd+hf5lpI8qTRbHlXx+ro1 JHYysaf6ckh5rPur+PU8aFkEHLsq2S9emG4WKpBvf3CXvu8ekBAWf1ty02IFJVbUa1gNZ/ q398Ik1pKvXTBBvg42rsuwyEOtt+l34= From: Paul Cercueil To: Michael Turquette , Stephen Boyd Cc: od@zcrc.me, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , kbuild test robot , Dan Carpenter Subject: [PATCH] clk: ingenic/jz4770: Exit with error if CGU init failed Date: Sat, 14 Dec 2019 23:35:00 +0100 Message-Id: <20191214223500.100093-1-paul@crapouillou.net> MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Exit jz4770_cgu_init() if the 'cgu' pointer we get is NULL, since the pointer is passed as argument to functions later on. Signed-off-by: Paul Cercueil Reported-by: kbuild test robot Reported-by: Dan Carpenter --- drivers/clk/ingenic/jz4770-cgu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/ingenic/jz4770-cgu.c b/drivers/clk/ingenic/jz4770-cgu.c index 956dd653a43d..c051ecba5cf8 100644 --- a/drivers/clk/ingenic/jz4770-cgu.c +++ b/drivers/clk/ingenic/jz4770-cgu.c @@ -432,8 +432,10 @@ static void __init jz4770_cgu_init(struct device_node *np) cgu = ingenic_cgu_new(jz4770_cgu_clocks, ARRAY_SIZE(jz4770_cgu_clocks), np); - if (!cgu) + if (!cgu) { pr_err("%s: failed to initialise CGU\n", __func__); + return; + } retval = ingenic_cgu_register_clocks(cgu); if (retval)