From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4AEE737267E; Sat, 12 Sep 2026 10:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789207366; cv=none; b=WvOG8lzCIUp0xv63Tlat0IhmBCgnvNds3LPKfWdZKZoqURN37dTeKykjx24WfjQBFgGbg5DNxlXF3KrmjLa/zH+i8Sck5WfYMCeP09CuII5AjbbOyGRALTj//6a8yFpjrIRxrycouQVbl0gwj96z/YQtMyNQ8Hx8TOCv8zaSVmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789207366; c=relaxed/simple; bh=5UJO1+dWti2pGXVeGdd+BDC+fFgIZg+kBnA3ZGVT7h0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iD83dScQ0zW/3z6vrDU9/01uGUhqUf5JfhYPZdJNGRCp/Vw2GqeK2/deOoNtfpKqRJZa4dGGpj8uj9eYMY3n7ICjVtemPIopmChxY5RP8HPGGjV60LLRD9afZpuKaMi3CM1dUer2F3AHPT3fk8k/EouwmECOXXMyEQutd/jAxOE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xIvRdAYy; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xIvRdAYy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E1191F000FF; Sat, 12 Sep 2026 10:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789207365; bh=LSZLSJQd80pBxLa3QW3g/ehjlp+Fko8zeCQ2Gc9Dtq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xIvRdAYygOe5x57a4nZt6JdiYRASnI95t0hun4JCSc/Ir6o4J4D35mb6e0HujfF/U hcE7MyjS/gr6yUCdzP+HUxmo4+FTnev5rHmIs0IDwavI57RuYoJV7AmAhRtt6ycZW2 aB0OIAYnS/hHCVdW9sRa1HNMrCwNW1Kdc9RutOnI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Zhongqiu Han , Viresh Kumar , Sasha Levin Subject: [PATCH 6.18 0397/1518] cpufreq: spear: Fix an IS_ERR() vs NULL bug in spear1340_set_cpu_rate() Date: Sat, 12 Sep 2026 08:42:46 +0200 Message-ID: <20260912065632.438245043@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 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 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit 6a9e0e0f7592313ace66303cf5eca68e04c10f30 ] The clk_get_parent() function doesn't return error pointers, it returns NULL on error. Update the error checking to match. Fixes: 420993221175 ("cpufreq: SPEAr: Add CPUFreq driver") Signed-off-by: Dan Carpenter Reviewed-by: Zhongqiu Han Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/spear-cpufreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 2a1550e1aa21f..6f8cd59baa36f 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -79,9 +79,9 @@ static int spear1340_set_cpu_rate(struct clk *sys_pclk, unsigned long newfreq) int ret = 0; sys_clk = clk_get_parent(spear_cpufreq.clk); - if (IS_ERR(sys_clk)) { + if (!sys_clk) { pr_err("failed to get cpu's parent (sys) clock\n"); - return PTR_ERR(sys_clk); + return -EINVAL; } /* Set the rate of the source clock before changing the parent */ -- 2.53.0