Skip to contentSkip to conversation

media: stm32: dcmipp: correct error handling in dcmipp_create_subdevs

git:media_stage/master Hans Verkuil 1 participant 1 message Jun 27, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: stm32: dcmipp: correct error handling in dcmipp_create_subdevs
Author:  Alain Volmat <[email protected]>
Date:    Mon Jun 24 10:41:22 2024 +0200

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")
 drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---

drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c +1 -1
index 4acc3b90d03a..4924ee36cfda 100644
@@ -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;
 }