lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251126-fix-error-state-v1-1-34f943a8b165@oss.qualcomm.com>
Date: Wed, 26 Nov 2025 09:53:08 +0530
From: Renjiang Han <renjiang.han@....qualcomm.com>
To: Vikash Garodia <vikash.garodia@....qualcomm.com>,
        Dikshita Agarwal <dikshita.agarwal@....qualcomm.com>,
        Bryan O'Donoghue <bod@...nel.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Renjiang Han <renjiang.han@....qualcomm.com>
Subject: [PATCH] media: venus: vdec: fix error state assignment for zero
 bytesused

Previously, the check for zero bytesused and the assignment of error
state was performed outside the V4L2_BUF_FLAG_LAST branch, which could
incorrectly set the error state during drain operations. This patch
moves the zero-bytesused check inside the 'else' branch, ensuring that
the error state is only set for non-EOS buffers with zero payload.

Additionally, the patch keeps the rest of the buffer state handling
logic unchanged, including handling of HFI_BUFFERFLAG_DATACORRUPT and
HFI_BUFFERFLAG_DROP_FRAME.

Signed-off-by: Renjiang Han <renjiang.han@....qualcomm.com>
---
This patch refines the error state assignment logic in the Venus vdec
driver for Qualcomm platforms. Specifically, it ensures that the buffer
state is only set to VB2_BUF_STATE_ERROR for non-EOS capture buffers
with zero bytesused, preventing false error reporting during drain
operations.
---
 drivers/media/platform/qcom/venus/vdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 4a6641fdffcf79705893be58c7ec5cf485e2fab9..d0bd2d86a31f9a18cb68b08ba66affdf8fc5092d 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1440,10 +1440,10 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
 				inst->drain_active = false;
 				inst->codec_state = VENUS_DEC_STATE_STOPPED;
 			}
+		} else {
+			if (!bytesused)
+				state = VB2_BUF_STATE_ERROR;
 		}
-
-		if (!bytesused)
-			state = VB2_BUF_STATE_ERROR;
 	} else {
 		vbuf->sequence = inst->sequence_out++;
 	}

---
base-commit: 663d0d1af3faefe673cabf4b6b077149a87ad71f
change-id: 20251126-fix-error-state-24183a8538cd

Best regards,
-- 
Renjiang Han <renjiang.han@....qualcomm.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ