Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    tina linux bug反馈

    其它全志芯片讨论区
    1
    1
    1108
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jinxiangwzh
      jinxiangwzh LV 7 last edited by

      lichee/linux-4.9/drivers/media/platform/sunxi-vin/vin-video/vin_video.c

      static int vin_close(struct file *file)
      {
      	struct vin_core *vinc = video_drvdata(file);
      	struct vin_md *vind = dev_get_drvdata(vinc->v4l2_dev->dev);
      	struct vin_vid_cap *cap = &vinc->vid_cap;
      	struct modules_config *module = &vind->modules[vinc->sensor_sel];
      	int valid_idx = module->sensors.valid_idx;
      	int ret;
      
      	if (!vin_busy(cap)) {
      		vin_warn("video%d have been closed!\n", vinc->id);
      		return 0;
      	}
      
      	if (vin_streaming(cap))
      		vin_timer_del(vinc);
      #if 0  // cause  kernel NULL pointer
      	mutex_lock(&cap->vdev.entity.graph_obj.mdev->graph_mutex);
      	if (!cap->pipe.sd[VIN_IND_SENSOR]->entity.use_count) {
      		vin_err("%s is not used, video%d cannot be close!\n", cap->pipe.sd[VIN_IND_SENSOR]->name, vinc->id);
      		mutex_unlock(&cap->vdev.entity.graph_obj.mdev->graph_mutex);
      		return -1;
      	}
      #endif
      	if (vin_streaming(cap)) {
      		clear_bit(VIN_STREAM, &cap->state);
      		vin_pipeline_call(vinc, set_stream, &cap->pipe, 0);
      		vb2_ioctl_streamoff(file, NULL, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
      	}
      

      这个位置的代码会造成系统崩溃

      	mutex_lock(&cap->vdev.entity.graph_obj.mdev->graph_mutex);
      	if (!cap->pipe.sd[VIN_IND_SENSOR]->entity.use_count) {
      		vin_err("%s is not used, video%d cannot be close!\n", cap->pipe.sd[VIN_IND_SENSOR]->name, vinc->id);
      		mutex_unlock(&cap->vdev.entity.graph_obj.mdev->graph_mutex);
      		return -1;
      	}
      
      1 Reply Last reply Reply Quote Share 0
      • 1 / 1
      • First post
        Last post

      Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策