Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9985654ybi; Wed, 24 Jul 2019 13:34:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyS6mNzcNkood5u+9YfvzUmy6+r7VIDRMQ9sHbyMF0XmOBAIq2SbvQ+6Hh1Hz9vBKLrMkKs X-Received: by 2002:a17:90a:24e4:: with SMTP id i91mr93035813pje.9.1564000468261; Wed, 24 Jul 2019 13:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000468; cv=none; d=google.com; s=arc-20160816; b=Shz7Z5HtljBmpIO3lnLW6m+WbgMt+ssoh5wj714+/3bSmv354mH4KxMrzuTXZ/oEg5 yDv36m9O3+9e1umFWiPp4al3HqtYWRwJqsPEEh3r0Cv7rlE52Fk/+iYThWcYL3OflcEU /BTu9nKen5iCF7yEz6+FdXiD0gzA651PedjHPBpq+GLx3YPFcNlBp3md2wGKlNR0+2OZ P6qUrp6PolCJJtxrTtFao2KaXFuOw1px9oMR/Ix4vK52UaKl0S7YQW0ihZwmjjWHN4Nl SyWor0pisgmdRn9upa6aESsUhAUDs7nSaSgTYUZnGA4QvPWfGhpttg1WC2t9JE4J+lZp r/+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zu7FxNuaUHUjwc8/SxvFiorrRN3etCJuCUDHKQo+/U4=; b=Ic/m9ZBGBveLNrowZrHwDBSdj15BbJOP35nQ1Sw0glMHlGaGskbjqeb2i4Y6UOJn+P D/O7Oh5B5j3F6W9at3PJKtOkyLNxRhKqZTSC/tMvt+VhVj2brLkkD2oiBb1+kNYrGmef wr7U1AjG3k2DuvCthWVyiYRR0ZWSZ90ak5tXo6Oap9hkpb4KjiazAIKwzo5QUVLyf9VM S7jGvNLuhGRAuJ1g2DKzpxMY02SKwwgr+ow9RBxk65sA/Ey3PEsxmftdoXcnT3fyHUCG cpmxy3iW/yrHWcKzrhfT6tnBbP1At0cfdJDpWhQT2YtE7QiWIP6T4uZI62HMHKBEjd4H v/eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dkIWiFgg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c76si15545285pfb.208.2019.07.24.13.34.13; Wed, 24 Jul 2019 13:34:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dkIWiFgg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388254AbfGXTaB (ORCPT + 99 others); Wed, 24 Jul 2019 15:30:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49684 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727302AbfGXT36 (ORCPT ); Wed, 24 Jul 2019 15:29:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 876432238C; Wed, 24 Jul 2019 19:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996597; bh=39gwfs7zH42d9G8RTt/ZE+bL7MJZDcrcQcu/PPWOfww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkIWiFggldRzxtKqfHeYjVyC6tzFgBlFJNiFq/WaQNptMAgQRkK06/WoYWMDyNTgm 3stfBnuK54jT7pAoFNIqsOM1Tg2i77iUaISkpkr/3EUenSuc8RZq3cpFJocqeqcFBY jL/C8GG6p84w57O+0G47InusMP8g3WDu/5oHapAw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Andr=C3=A9=20Almeida?= , Helen Koike , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.2 151/413] media: vimc: cap: check v4l2_fill_pixfmt return value Date: Wed, 24 Jul 2019 21:17:22 +0200 Message-Id: <20190724191745.787752001@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 Suggested-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 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) " -- 2.20.1