Skip to content

Commit a7351f0

Browse files
Alain VolmatHans Verkuil
authored andcommitted
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: 28e0f37 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver") Cc: [email protected] Signed-off-by: Alain Volmat <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Acked-by: Sakari Ailus <[email protected]> [hverkuil: correct the indices: it's [i], not [i - 1].]
1 parent 5d5f67b commit a7351f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ static int dcmipp_create_subdevs(struct dcmipp_device *dcmipp)
202202
return 0;
203203

204204
err_init_entity:
205-
while (i > 0)
206-
dcmipp->pipe_cfg->ents[i - 1].release(dcmipp->entity[i - 1]);
205+
while (i-- > 0)
206+
dcmipp->pipe_cfg->ents[i].release(dcmipp->entity[i]);
207207
return ret;
208208
}
209209

0 commit comments

Comments
 (0)