<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[tina linux bug反馈]]></title><description><![CDATA[<p dir="auto">lichee/linux-4.9/drivers/media/platform/sunxi-vin/vin-video/vin_video.c</p>
<pre><code>static int vin_close(struct file *file)
{
	struct vin_core *vinc = video_drvdata(file);
	struct vin_md *vind = dev_get_drvdata(vinc-&gt;v4l2_dev-&gt;dev);
	struct vin_vid_cap *cap = &amp;vinc-&gt;vid_cap;
	struct modules_config *module = &amp;vind-&gt;modules[vinc-&gt;sensor_sel];
	int valid_idx = module-&gt;sensors.valid_idx;
	int ret;

	if (!vin_busy(cap)) {
		vin_warn("video%d have been closed!\n", vinc-&gt;id);
		return 0;
	}

	if (vin_streaming(cap))
		vin_timer_del(vinc);
#if 0  // cause  kernel NULL pointer
	mutex_lock(&amp;cap-&gt;vdev.entity.graph_obj.mdev-&gt;graph_mutex);
	if (!cap-&gt;pipe.sd[VIN_IND_SENSOR]-&gt;entity.use_count) {
		vin_err("%s is not used, video%d cannot be close!\n", cap-&gt;pipe.sd[VIN_IND_SENSOR]-&gt;name, vinc-&gt;id);
		mutex_unlock(&amp;cap-&gt;vdev.entity.graph_obj.mdev-&gt;graph_mutex);
		return -1;
	}
#endif
	if (vin_streaming(cap)) {
		clear_bit(VIN_STREAM, &amp;cap-&gt;state);
		vin_pipeline_call(vinc, set_stream, &amp;cap-&gt;pipe, 0);
		vb2_ioctl_streamoff(file, NULL, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
	}
</code></pre>
<p dir="auto">这个位置的代码会造成系统崩溃</p>
<pre><code>	mutex_lock(&amp;cap-&gt;vdev.entity.graph_obj.mdev-&gt;graph_mutex);
	if (!cap-&gt;pipe.sd[VIN_IND_SENSOR]-&gt;entity.use_count) {
		vin_err("%s is not used, video%d cannot be close!\n", cap-&gt;pipe.sd[VIN_IND_SENSOR]-&gt;name, vinc-&gt;id);
		mutex_unlock(&amp;cap-&gt;vdev.entity.graph_obj.mdev-&gt;graph_mutex);
		return -1;
	}
</code></pre>
]]></description><link>https://bbs.aw-ol.com/topic/1566/tina-linux-bug反馈</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 15:25:38 GMT</lastBuildDate><atom:link href="https://bbs.aw-ol.com/topic/1566.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Jun 2022 05:57:47 GMT</pubDate><ttl>60</ttl></channel></rss>