From patchwork Mon Oct 12 18:04:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 11833531 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 655A3139F for ; Mon, 12 Oct 2020 18:04:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5885A20776 for ; Mon, 12 Oct 2020 18:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404175AbgJLSEq (ORCPT ); Mon, 12 Oct 2020 14:04:46 -0400 Received: from retiisi.eu ([95.216.213.190]:45572 "EHLO hillosipuli.retiisi.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404156AbgJLSEq (ORCPT ); Mon, 12 Oct 2020 14:04:46 -0400 Received: from lanttu.localdomain (unknown [IPv6:2a01:4f9:c010:4572::e1:1002]) by hillosipuli.retiisi.eu (Postfix) with ESMTP id C9367634C87; Mon, 12 Oct 2020 21:03:38 +0300 (EEST) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: Tsuchiya Yuto , bingbu.cao@intel.com, Yong Zhi , Tianshu Qiu , laurent.pinchart@ideasonboard.com Subject: [PATCH v3 8/8] ipu3-cio2: Remove traces of returned buffers Date: Mon, 12 Oct 2020 21:04:14 +0300 Message-Id: <20201012180414.11579-9-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201012180414.11579-1-sakari.ailus@linux.intel.com> References: <20201012180414.11579-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org If starting a video buffer queue fails, the buffers are returned to videobuf2. Remove the reference to the buffer from driver's queue as well. Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver") Signed-off-by: Sakari Ailus Cc: stable@vger.kernel.org # v4.16 and up Reviewed-by: Andy Shevchenko Reviewed-by: Laurent Pinchart --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index d9baa8bfe54f..51c4dd6a8f9a 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -791,6 +791,7 @@ static void cio2_vb2_return_all_buffers(struct cio2_queue *q, atomic_dec(&q->bufs_queued); vb2_buffer_done(&q->bufs[i]->vbb.vb2_buf, state); + q->bufs[i] = NULL; } } }