aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAlain Volmat <alain.volmat@foss.st.com>2024-07-03 13:59:16 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-07-03 15:52:24 +0200
commita7351f0d3668b449fdc2cfd90403b1cb1f03ed6d (patch)
treeffefca530a1282f6f8f3236d65c976cb399f38f9
parentmedia: atomisp: Fix spelling mistakes in sh_css_sp.c (diff)
downloadwireguard-linux-a7351f0d3668b449fdc2cfd90403b1cb1f03ed6d.tar.xz
wireguard-linux-a7351f0d3668b449fdc2cfd90403b1cb1f03ed6d.zip
media: stm32: dcmipp: correct error handling in dcmipp_create_subdevs
Correct error handling within the dcmipp_create_subdevs by properly decrementing the i counter when releasing the subdevs. Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver") Cc: stable@vger.kernel.org Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> [hverkuil: correct the indices: it's [i], not [i - 1].]
-rw-r--r--drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
index 4acc3b90d03a..7f771ea49b78 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
@@ -202,8 +202,8 @@ static int dcmipp_create_subdevs(struct dcmipp_device *dcmipp)
return 0;
err_init_entity:
- while (i > 0)
- dcmipp->pipe_cfg->ents[i - 1].release(dcmipp->entity[i - 1]);
+ while (i-- > 0)
+ dcmipp->pipe_cfg->ents[i].release(dcmipp->entity[i]);
return ret;
}