Web lists-archives.com

question about soc_camera_open




Dear Guennadi

soc_camera_open use icd->current_fmt directly.
It doesn't check if icd->current_fmt != NULL.

	if (icd->use_count == 1) {
		/* Restore parameters before the last close() per V4L2 API */
		struct v4l2_format f = {
			.type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
			.fmt.pix = {
				.width		= icd->width,
				.height		= icd->height,
				.field		= icd->field,
=>				.pixelformat	= icd->current_fmt->fourcc,
=>				.colorspace	= icd->current_fmt->colorspace,
			},
		};


if soc_camera_init_user_formats return -ENXIO,
then, icd->current_fmt is still NULL.

	if (!ici->ops->get_formats)
		/*
		 * Fallback mode - the host will have to serve all
		 * sensor-provided formats one-to-one to the user
		 */
		fmts = icd->num_formats;
	else
		/*
		 * First pass - only count formats this host-sensor
		 * configuration can provide
		 */
		for (i = 0; i < icd->num_formats; i++)
			fmts += ici->ops->get_formats(icd, i, NULL);

	if (!fmts)
=>		return -ENXIO;

in my environment, I can use "sh_mobile_ceu" and "soc_camera_platform",
if sh_mobile_ceu_try_bus_param failed, this process will run above way.
and it will be kernel panic.
Is this bug ??

Best regards
--
Kuninori Morimoto
 

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list