OSDN Git Service

media: stm32-dcmi: fix crash when subdev do not expose any formats
authorHugues Fruchet <hugues.fruchet@st.com>
Mon, 1 Apr 2019 08:56:09 +0000 (04:56 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:18 +0000 (06:46 -0700)
commit2096b3ba3274d28d9b26d817dc0fcbf5ea7c03a0
tree92ef2f09ab5ba67d27a28cb1e55ef412313ffdff
parent6c21fa849a5abbceb6b7b6db053adfe5fb5193f5
media: stm32-dcmi: fix crash when subdev do not expose any formats

[ Upstream commit 33dfeb62e23c31619d2197850f7e8b50e8cc5466 ]

Do not access sd_formats[] if num_of_sd_formats is zero, ie
subdev sensor didn't expose any formats.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/stm32/stm32-dcmi.c