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 291C217CA12; Mon, 10 Mar 2025 17:50:03 +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=1741629004; cv=none; b=cLHW4HZiTQtq4c7wLYj7RtcLDNH5sl3BsQnNcXOTCfrqpfqxTF4PXIbAh7doQM7f79eX1Vka9ckyn8On0XaH8eN20wOlMrZ8+ldNyr59X66l/jwgxdOQ4aY/N2kqv2+5XH31ScPjJSAgEF5FzqaXJ/lAEcAieTo6K5pFR4gieGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629004; c=relaxed/simple; bh=gWFEy8sGfu2KRpF1ORWF9g8dw4YdpoUyfT1fVHVOaeQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R2h/GnQZUdk6gl293yeLOXwsrxPlwCXQImnGNkDnMXdRo5rkaMqV5WWQ72o6xKXNFxrs6e/9zT+1xaROUn50dt1xreiMjdztytZoWcAvK99IZlsYkDMDYsZadI5OT9lb6yWC/j3nK4yQsLsmA6Qofb5W7Eg9F9DtCepIl6AXzUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qeR1fUFz; 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="qeR1fUFz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 364FEC4CEE5; Mon, 10 Mar 2025 17:50:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741629003; bh=gWFEy8sGfu2KRpF1ORWF9g8dw4YdpoUyfT1fVHVOaeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qeR1fUFzMLMWoc/5ffzoBtvangH0cGc/b0PuKuKIYHjWtsp2/X2StxVYCG5rtI3Qr VSc655ATYc2tyBQem42scC4CpYXhIsWeopi0YtkS8DKES7j+rUo1Hrc+i56YdL/66h KK5Un0w+iyk2jnI3yExwyV3g0U54+0rXGtB48pdI= 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 5.15 142/620] media: mipi-csis: Add check for clk_enable() Date: Mon, 10 Mar 2025 17:59:48 +0100 Message-ID: <20250310170551.202808690@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@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 5.15-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/exynos4-is/mipi-csis.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index 32b23329b0331..51467ddff185b 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -942,13 +942,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