From patchwork Thu Feb 13 16:19:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11380769 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 B240492A for ; Thu, 13 Feb 2020 16:20:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 906C32073C for ; Thu, 13 Feb 2020 16:20:05 +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="yamZkqpn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727705AbgBMQUE (ORCPT ); Thu, 13 Feb 2020 11:20:04 -0500 Received: from outils.crapouillou.net ([89.234.176.41]:55850 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727675AbgBMQUE (ORCPT ); Thu, 13 Feb 2020 11:20:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1581610802; 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=zvvISmkod8AHsh7UjrYeGbpLfDZzM5JquD/5OioWC1M=; b=yamZkqpnf2uFWWjK9a2OjcPgxGfvfIHED5144hxBDQyFcNZaHmlXRCmsdAmuDdckD6YQtr jVyLjweZPAEZAeA3hTWvrjZlK3W6Jwd1bT/IF6CojgsRORZLY9cfZdcBA1a5hujZoS+LTQ 2drNgAZuRxMeZY18FKRFydN9JfzaI8s= From: Paul Cercueil To: Michael Turquette , Stephen Boyd Cc: od@zcrc.me, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , stable@vger.kernel.org, kbuild test robot , Dan Carpenter Subject: [PATCH v2 1/2] clk: ingenic/jz4770: Exit with error if CGU init failed Date: Thu, 13 Feb 2020 13:19:51 -0300 Message-Id: <20200213161952.37460-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. Fixes: 7a01c19007ad ("clk: Add Ingenic jz4770 CGU driver") Cc: stable@vger.kernel.org Signed-off-by: Paul Cercueil Reported-by: kbuild test robot Reported-by: Dan Carpenter --- Notes: v2: Added Fixes: tag 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)