7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak [ Upstream commit 9887716132d6c3c58cc67841dfb441c5a4a0d209 ] mmpcam_probe() registers an OF clock provider before requesting the IRQ. Neither a later probe failure nor driver removal unregisters that provider, although the underlying clock is registered with devm_clk_register(). This leaves the provider referring to a clock whose lifetime has ended. Use devm_of_clk_add_hw_provider() with the existing mclk_hw so the provider is unregistered before the managed clock and camera storage are released. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: 81a409bfd551 ("media: marvell-ccic: provide a clock for the sensor") Cc: stable@vger.kernel.org Assisted-by: OpenAI:GPT-5.6 Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/marvell/mmp-driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/marvell/mmp-driver.c b/drivers/media/platform/marvell/mmp-driver.c index d3da7ebb4a2be..4c31b62751a12 100644 --- a/drivers/media/platform/marvell/mmp-driver.c +++ b/drivers/media/platform/marvell/mmp-driver.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "mcam-core.h" @@ -269,8 +270,8 @@ static int mmpcam_probe(struct platform_device *pdev) /* * Add OF clock provider. */ - ret = of_clk_add_provider(pdev->dev.of_node, of_clk_src_simple_get, - mcam->mclk); + ret = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, + &mcam->mclk_hw); if (ret) { dev_err(&pdev->dev, "can't add DT clock provider\n"); goto out; -- 2.53.0