tina linux bug反馈
-
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; }
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号