ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev
Cc: Yong Deng <yong.deng@magewell.com>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Conor Dooley <conor@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH v3 12/12] media: sun6i-isp: params: Unregister pending buffer on cleanup
Date: Thu,  8 Dec 2022 15:20:06 +0100	[thread overview]
Message-ID: <20221208142006.425809-13-paul.kocialkowski@bootlin.com> (raw)
In-Reply-To: <20221208142006.425809-1-paul.kocialkowski@bootlin.com>

The state cleanup helper should unregister the pending buffer from
the state after returning it to v4l2, like it is done for other
buffers in the wait queue.

Before this change, the pending buffer from a previous run might have
been returned at the beginning of the next run, causing an error.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Fixes: e3185e1d7c14 ("media: staging: media: Add support for the Allwinner A31 ISP")
---
 drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
index 7b41a13162b9..e28be895b486 100644
--- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
+++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
@@ -208,6 +208,8 @@ static void sun6i_isp_params_state_cleanup(struct sun6i_isp_device *isp_dev,
 		vb2_buffer = &state->pending->v4l2_buffer.vb2_buf;
 		vb2_buffer_done(vb2_buffer, error ? VB2_BUF_STATE_ERROR :
 				VB2_BUF_STATE_QUEUED);
+
+		state->pending = NULL;
 	}
 
 	list_for_each_entry(isp_buffer, &state->queue, list) {
-- 
2.38.1


  parent reply	other threads:[~2022-12-08 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 14:19 [PATCH v3 00/12] Allwinner A31/A83T CSI/ISP/MIPI CSI-2 media fixes Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 01/12] media: sun6i-csi: bridge: Fix return code handling in stream off path Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 02/12] media: sun6i-csi: bridge: Error out on invalid port to fix warning Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 03/12] media: sunxi-csi: bridge: Declare subdev ops as static Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 04/12] media: sun6i-csi: capture: Remove useless ret initialization Paul Kocialkowski
2022-12-08 14:19 ` [PATCH v3 05/12] media: sun6i-mipi-csi2: Clarify return code handling in stream off path Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 06/12] media: sun8i-a83t-mipi-csi2: " Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 07/12] media: sun6i-isp: proc: Fix " Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 08/12] media: sun6i-isp: proc: Error out on invalid port to fix warning Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 09/12] media: sun6i-isp: proc: Declare subdev ops as static Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 10/12] media: sun6i-isp: capture: Fix uninitialized variable use Paul Kocialkowski
2022-12-08 14:20 ` [PATCH v3 11/12] media: sun6i-isp: params: Fix incorrect indentation Paul Kocialkowski
2022-12-08 14:20 ` Paul Kocialkowski [this message]
2022-12-17  4:12 ` [PATCH v3 00/12] Allwinner A31/A83T CSI/ISP/MIPI CSI-2 media fixes Palmer Dabbelt

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=20221208142006.425809-13-paul.kocialkowski@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=conor@kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=nathan@kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=samuel@sholland.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.org \
    --cc=yong.deng@magewell.com \
    /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