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: <20220427085942.18159-1-ming.qian@nxp.com>
Date:   Wed, 27 Apr 2022 16:59:42 +0800
From:   Ming Qian <ming.qian@....com>
To:     mchehab@...nel.org, shawnguo@...nel.org, hverkuil-cisco@...all.nl
Cc:     robh+dt@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
        festevam@...il.com, linux-imx@....com, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v2] media: amphion: ensure the buffer count is not less than min_buffer

the output buffer count should >= min_buffer_out
the capture buffer count should >= min_buffer_cap

Signed-off-by: Ming Qian <ming.qian@....com>
---
v2
- don't mess up the VIDIOC_CREATE_BUFS ioctl

 drivers/media/platform/amphion/vpu_v4l2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
index 9c0704cd5766..0d25ba3afbf6 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -340,8 +340,12 @@ static int vpu_vb2_queue_setup(struct vb2_queue *vq,
 				return -EINVAL;
 		}
 		return 0;
+	} else {
+		if (V4L2_TYPE_IS_OUTPUT(vq->type))
+			*buf_count = max_t(unsigned int, *buf_count, inst->min_buffer_out);
+		else
+			*buf_count = max_t(unsigned int, *buf_count, inst->min_buffer_cap);
 	}
-
 	*plane_count = cur_fmt->num_planes;
 	for (i = 0; i < cur_fmt->num_planes; i++)
 		psize[i] = cur_fmt->sizeimage[i];
-- 
2.36.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ