导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    tina linux bug反馈

    其它全志芯片讨论区
    1
    1
    1123
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • jinxiangwzh
      jinxiangwzh LV 7 最后由 编辑

      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 条回复 最后回复 回复 引用 分享 0
      • 1 / 1
      • First post
        Last post

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

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