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 04D471DC9AF; Wed, 5 Feb 2025 14:52:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738767168; cv=none; b=NEAL4AE7CuNXdqbzG5SMaltBg1Y4esAb36OhK/f3Jl8nQsc0TQBsOMkg+fxPFT8VqebZYq4F56cCuUdIvr5e1oRKDfzwF5ruxaQA+pzQM86isB2KOgkRjrjMxKZfOS6TtbtC9Y68ap2xyl0r4NfBnVz6YWaO9zjxGJFMCm1XYzg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738767168; c=relaxed/simple; bh=COP9ZA5qjhPyhRCWFSJwaHWzibla62j3CTG/b3RT+gI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tYuuBrSNIIOhsxdQegxqYBOfUzP5gsJ1IH91bAS0rAJtBmB9epUyYvksGabZi+ig8izGPBZvqliXQUU02I8VEuI16DZYlH5VyzF8+LmIjIL5aUixm2jGSMw552RRPzZo0Df7MsdbLWWP6cr/uLPjXFrXpvmmVUkUQjnIpqFOeMU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=F0fIqw8o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="F0fIqw8o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67991C4CED1; Wed, 5 Feb 2025 14:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738767167; bh=COP9ZA5qjhPyhRCWFSJwaHWzibla62j3CTG/b3RT+gI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F0fIqw8oAVrfOc7WF/H5Gce/HVcQoMB8i504NzUVtHyu7G598iHUGsZ+QbqZqJFQ1 X+ZOY3bDfBG2qE8cDuoQ+JHXAA32/u/evLGHVj+iofY/e3Flz7WJXeFVC5BezkcBCk LJQQsdMBv5cL3kMz2V2vA3X4VYnepotrMLO9L66k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiasheng Jiang , Krzysztof Kozlowski , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 6.12 415/590] media: mipi-csis: Add check for clk_enable() Date: Wed, 5 Feb 2025 14:42:50 +0100 Message-ID: <20250205134511.141719908@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250205134455.220373560@linuxfoundation.org> References: <20250205134455.220373560@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiasheng Jiang [ Upstream commit 125ad1aeec77eb55273b420be6894b284a01e4b6 ] Add check for the return value of clk_enable() to gurantee the success. Fixes: b5f1220d587d ("[media] v4l: Add v4l2 subdev driver for S5P/EXYNOS4 MIPI-CSI receivers") Signed-off-by: Jiasheng Jiang Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/samsung/exynos4-is/mipi-csis.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c index 4b9b20ba35041..38c5f22b850b9 100644 --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c @@ -940,13 +940,19 @@ static int s5pcsis_pm_resume(struct device *dev, bool runtime) state->supplies); goto unlock; } - clk_enable(state->clock[CSIS_CLK_GATE]); + ret = clk_enable(state->clock[CSIS_CLK_GATE]); + if (ret) { + phy_power_off(state->phy); + regulator_bulk_disable(CSIS_NUM_SUPPLIES, + state->supplies); + goto unlock; + } } if (state->flags & ST_STREAMING) s5pcsis_start_stream(state); state->flags &= ~ST_SUSPENDED; - unlock: +unlock: mutex_unlock(&state->lock); return ret ? -EAGAIN : 0; } -- 2.39.5