Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2503648imm; Mon, 24 Sep 2018 05:34:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYrrVVva8t3hMN9L+Jyq0HrhiSknmFbuIl3zBYjuNvsnfrsPe4RM24HBA0CdhGRUgcPKCXD X-Received: by 2002:a62:3c7:: with SMTP id 190-v6mr10119203pfd.145.1537792486360; Mon, 24 Sep 2018 05:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792486; cv=none; d=google.com; s=arc-20160816; b=LOznvGw/PsZav7KSGc4o+5Y4q/dQsFSvDGfR0aA5aSqkfW0kO5pexW3NQt3obUTNqd yZ24I1lltMQnmrLUYYecxUmWQWyOA/pEmr3hq/BxIqEmIOrI5+vCYTk14ca6kwKsd7su 3HxpWAvfyZ9CCu+qjlJ/dbn3XvyM4YLS4bNCMj07aPnhsU355atSv8IWwwYkgxzfdPiN 4beXWG5vmIboTHic9lSFxqCMk8pDDpcaodZXZmuYmlkRc2UaIA6ghpvLq7MpUTHDf2o/ TOIYLx8oVAD0/myV2DzJMQXgRL0zZRwCWxW702OAWHP9FBDvxtmFXjBpocVnsSwUu3g4 UkSw== 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; bh=aVH1UPquOHPVt4ZpoZZTOgimKXx/v3VAOchrZW7Xdys=; b=EEMMdOKefJG/ZKFcp2Iol5x14Yp5BbXxaEwr3zBl2IAkyK5DfDpBg8VnWwUV33JGAI gD3jGmV2McrgWmIZHWvIJnLhst9pykY3lF3Sbj6Ha948KJBIdBEPRLG3XWjssqjqeAFg 9xgA6vwjn8c6xs0xLVNy4eSUKBl/BLa5ylTmgpigMjykgAEmPSVPKsNB7O8/C7KMB79l Bt4JfEGxq4xiG7j5HiO3ieJ7PuAsCsgAUWiNP7O2Ft3MNJnwAnqEb2G1cbrxu127V4TA wUt3JFRvqgx7EGQoG+hmp6GjtdRVxIkG1mWj+uKr56VlipuiQywvnWL88SnSj0iCPYTp odpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t23-v6si2981850pgl.618.2018.09.24.05.34.30; Mon, 24 Sep 2018 05:34:46 -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; 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 S2388121AbeIXSeG (ORCPT + 99 others); Mon, 24 Sep 2018 14:34:06 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58098 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730184AbeIXSeF (ORCPT ); Mon, 24 Sep 2018 14:34:05 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3E8BE109A; Mon, 24 Sep 2018 12:32:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.18 039/235] media: videobuf2-core: check for q->error in vb2_core_qbuf() Date: Mon, 24 Sep 2018 13:50:25 +0200 Message-Id: <20180924113108.976570292@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil [ Upstream commit b509d733d337417bcb7fa4a35be3b9a49332b724 ] The vb2_core_qbuf() function didn't check if q->error was set. It is checked in __buf_prepare(), but that function isn't called if the buffer was already prepared before with VIDIOC_PREPARE_BUF. So check it at the start of vb2_core_qbuf() as well. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/common/videobuf2/videobuf2-core.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -1377,6 +1377,11 @@ int vb2_core_qbuf(struct vb2_queue *q, u struct vb2_buffer *vb; int ret; + if (q->error) { + dprintk(1, "fatal error occurred on queue\n"); + return -EIO; + } + vb = q->bufs[index]; switch (vb->state) {