linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "André Almeida" <andrealmeid@collabora.com>,
	"Helen Koike" <helen.koike@collabora.com>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"Mauro Carvalho Chehab" <mchehab+samsung@kernel.org>,
	"Sasha Levin" <sashal@kernel.org>,
	linux-media@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 100/158] media: vimc: cap: check v4l2_fill_pixfmt return value
Date: Mon, 15 Jul 2019 10:17:11 -0400	[thread overview]
Message-ID: <20190715141809.8445-100-sashal@kernel.org> (raw)
In-Reply-To: <20190715141809.8445-1-sashal@kernel.org>

From: André Almeida <andrealmeid@collabora.com>

[ 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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c
index 65d657daf66f..8e014cc485f0 100644
--- a/drivers/media/platform/vimc/vimc-capture.c
+++ b/drivers/media/platform/vimc/vimc-capture.c
@@ -132,12 +132,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) "
-- 
2.20.1


  parent reply	other threads:[~2019-07-15 14:55 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190715141809.8445-1-sashal@kernel.org>
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 011/158] media: dvb: usb: fix use after free in dvb_usb_device_exit Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 012/158] media: spi: IR LED: add missing of table registration Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 014/158] media: ov7740: avoid invalid framesize setting Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 015/158] media: marvell-ccic: fix DMA s/g desc number calculation Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 016/158] media: vpss: fix a potential NULL pointer dereference Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 017/158] media: media_device_enum_links32: clean a reserved field Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 029/158] media: mc-device.c: don't memset __user pointer contents Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 030/158] media: saa7164: fix remove_proc_entry warning Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 031/158] media: staging: media: davinci_vpfe: - Fix for memory leak if decoder initialization fails Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 035/158] tua6100: Avoid build warnings Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 038/158] media: wl128x: Fix some error handling in fm_v4l2_init_video_device() Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 056/158] media: uvcvideo: Fix access to uninitialized fields on probe error Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 057/158] media: fdp1: Support M3N and E3 platforms Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 063/158] media: s5p-mfc: fix reading min scratch buffer size on MFC v6/v7 Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 092/158] media: s5p-mfc: Make additional clocks optional Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 093/158] media: i2c: fix warning same module names Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 097/158] media: coda: fix mpeg2 sequence number handling Sasha Levin
2019-07-26 18:07   ` Pavel Machek
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 098/158] media: coda: fix last buffer handling in V4L2_ENC_CMD_STOP Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 099/158] media: coda: increment sequence offset for the last returned frame Sasha Levin
2019-07-15 14:17 ` Sasha Levin [this message]
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 101/158] media: hdpvr: fix locking and a missing msleep Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190715141809.8445-100-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=andrealmeid@collabora.com \
    --cc=helen.koike@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).