]> Git Repo - linux.git/commitdiff
media: stm32: dcmipp: correct error handling in dcmipp_create_subdevs
authorAlain Volmat <[email protected]>
Wed, 3 Jul 2024 11:59:16 +0000 (13:59 +0200)
committerHans Verkuil <[email protected]>
Wed, 3 Jul 2024 13:52:24 +0000 (15:52 +0200)
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: [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].]

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

index 4acc3b90d03aa5d096a550b7997894cd5fb88ff0..7f771ea49b78484560af9f543e916406f4f2945e 100644 (file)
@@ -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;
 }
 
This page took 0.065 seconds and 4 git commands to generate.