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 BEF2925DD00; Tue, 11 Mar 2025 15:04:46 +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=1741705486; cv=none; b=X9opgCQ44EzXbpwDPZ+pfCb9DO+gyXWJcabvyMSrtX/pPcd7FxLoXQLhtzr3lU9rKg2WDPMntMh5hj+/+W78/yaq/QuHATapaBK37UGiryKH5gbBeo3tLaPSwaMa6SfoY51LLyYUchYnnimJtWE+uJh1V9vg9J+fnmoTTXUnR+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741705486; c=relaxed/simple; bh=siH+yEDM+r2KT7t6ztvH9ZMg4g8/ddIBx2YRTPIOikI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tfUtIr7qijJ16p2hOF7AtsJTz+bLt2XBA6OfGcrwReUImL6uu+KoS8TmsvVFbv0MtA/khlCYxw+SqoytScrVRinCietfY3tWTyTNvR4b3giNOGwm5H2ZHDsjfPZVPX6uqemTOjXkURCMwGMbuwivqbKwPW4x20tbJZWdezh8wg8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MsOjsW8y; 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="MsOjsW8y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48183C4CEE9; Tue, 11 Mar 2025 15:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741705486; bh=siH+yEDM+r2KT7t6ztvH9ZMg4g8/ddIBx2YRTPIOikI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MsOjsW8yk3Kxkh3r1UdcseuOSOVEXf17Xr0KN2OGcPQiNRHA8DtKtsLE3ITWhCkX8 QSxXehcKD5NhYvL58Ovk0Nj9UESLPklNR5oZ9idDgaLjrDKPxm7C0btIyoGsGNAX+6 CE4B+9UxlznORAGjUrCDTkKsacwfZX7EbWDEpuXM= 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.4 052/328] media: mipi-csis: Add check for clk_enable() Date: Tue, 11 Mar 2025 15:57:02 +0100 Message-ID: <20250311145716.963981390@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145714.865727435@linuxfoundation.org> References: <20250311145714.865727435@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.4-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 1aac167abb175..6a2a85cc3e5f9 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -941,13 +941,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