summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorAlain Volmat <alain.volmat@foss.st.com>2024-06-24 10:41:22 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-06-27 13:06:47 +0200
commit77d32b7e2a7b2e5389b67363d25371b4b8cad140 (patch)
tree21387b00ac16e5caa93c1a36a8db236393667c28 /drivers/media
parent5b683b20309c0f45f2894ac0d01af25a61feffc5 (diff)
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 subdeves. 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: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c2
1 files changed, 1 insertions, 1 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..4924ee36cfda 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
@@ -202,7 +202,7 @@ static int dcmipp_create_subdevs(struct dcmipp_device *dcmipp)
return 0;
err_init_entity:
- while (i > 0)
+ while (i-- > 0)
dcmipp->pipe_cfg->ents[i - 1].release(dcmipp->entity[i - 1]);
return ret;
}