From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13AC77469 for ; Sun, 17 Sep 2023 20:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72979C433C9; Sun, 17 Sep 2023 20:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694982246; bh=SKvm3Tu/Z24JKImr+Jckh5/jjyDQQhsg1G7hdbc/5tY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URw6Ejf5h9ROzx6l72vWF1QJgdsCIlMf7oQqV0w5Gt/RSwa+c0yt7yEzFw4CEEgKH hyfjyuLoz0Q4sQxv+kC+aKUXpAYtAFG/5AHGYiIvrSMoUJ3ya1CsAqw/XrKTDZpSEN DFeBxqBGUu3nACWYAHE0hbfUSzdy+4zSlat5Y2KM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Minjie Du , Stephen Boyd , Sasha Levin Subject: [PATCH 5.15 195/511] drivers: clk: keystone: Fix parameter judgment in _of_pll_clk_init() Date: Sun, 17 Sep 2023 21:10:22 +0200 Message-ID: <20230917191118.528802997@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230917191113.831992765@linuxfoundation.org> References: <20230917191113.831992765@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Minjie Du [ Upstream commit a995c50db887ef97f3160775aef7d772635a6f6e ] The function clk_register_pll() may return NULL or an ERR_PTR. Don't treat an ERR_PTR as valid. Signed-off-by: Minjie Du Link: https://lore.kernel.org/r/20230712102246.10348-1-duminjie@vivo.com Fixes: b9e0d40c0d83 ("clk: keystone: add Keystone PLL clock driver") [sboyd@kernel.org: Reword commit text] Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/keystone/pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c index d59a7621bb204..ee5c72369334f 100644 --- a/drivers/clk/keystone/pll.c +++ b/drivers/clk/keystone/pll.c @@ -209,7 +209,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl) } clk = clk_register_pll(NULL, node->name, parent_name, pll_data); - if (clk) { + if (!IS_ERR_OR_NULL(clk)) { of_clk_add_provider(node, of_clk_src_simple_get, clk); return; } -- 2.40.1