media: vimc: cap: check v4l2_fill_pixfmt return value
authorAndré Almeida <andrealmeid@collabora.com>
Mon, 17 Jun 2019 16:28:02 +0000 (12:28 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:14:11 +0000 (09:14 +0200)
commit43b9fdc48377d4ba22ee8d47c9566c71854ae1be
tree128c2b3ce81ff18c709fc6c6f01255176d64145c
parentd562537dbf0d884fab82654ed3df0130736b0903
media: vimc: cap: check v4l2_fill_pixfmt return value

[ Upstream commit 77ae46e11df5c96bb4582633851f838f5d954df4 ]

v4l2_fill_pixfmt() returns -EINVAL if the pixelformat used as parameter is
invalid or if the user is trying to use a multiplanar format with the
singleplanar API. Currently, the vimc_cap_try_fmt_vid_cap() returns such
value, but vimc_cap_s_fmt_vid_cap() is ignoring it. Fix that and returns
an error value if vimc_cap_try_fmt_vid_cap() has failed.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
Suggested-by: Helen Koike <helen.koike@collabora.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/vimc/vimc-capture.c