diff options
| author | André Almeida <[email protected]> | 2019-06-17 16:28:02 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2019-06-24 18:58:40 +0000 |
| commit | 77ae46e11df5c96bb4582633851f838f5d954df4 (patch) | |
| tree | c0201db56c51d9929c0e1b64abc9e7a8379292ef /drivers/media/platform/vimc/vimc-capture.c | |
| parent | media: media/pci: set device_caps in struct video_device (diff) | |
| download | kernel-77ae46e11df5c96bb4582633851f838f5d954df4.tar.gz kernel-77ae46e11df5c96bb4582633851f838f5d954df4.zip | |
media: vimc: cap: check v4l2_fill_pixfmt return value
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 <[email protected]>
Suggested-by: Helen Koike <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'drivers/media/platform/vimc/vimc-capture.c')
| -rw-r--r-- | drivers/media/platform/vimc/vimc-capture.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c index 946dc0908566..664855708fdf 100644 --- a/drivers/media/platform/vimc/vimc-capture.c +++ b/drivers/media/platform/vimc/vimc-capture.c @@ -142,12 +142,15 @@ static int vimc_cap_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) { struct vimc_cap_device *vcap = video_drvdata(file); + int ret; /* Do not change the format while stream is on */ if (vb2_is_busy(&vcap->queue)) return -EBUSY; - vimc_cap_try_fmt_vid_cap(file, priv, f); + ret = vimc_cap_try_fmt_vid_cap(file, priv, f); + if (ret) + return ret; dev_dbg(vcap->dev, "%s: format update: " "old:%dx%d (0x%x, %d, %d, %d, %d) " |
