Commit a7351f0d authored by Alain Volmat's avatar Alain Volmat Committed by Hans Verkuil

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: 28e0f377 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAlain Volmat <alain.volmat@foss.st.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
[hverkuil: correct the indices: it's [i], not [i - 1].]
parent 5d5f67b3
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment