From: jintao xu Date: Thu, 28 Nov 2019 06:24:40 +0000 (+0800) Subject: v4lvideo: fix cat dev panic [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f0d38a6b7f8e7c74539e849bb35c594e1f57869;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git v4lvideo: fix cat dev panic [1/1] PD#SWPL-17478 Problem: cat /dev/video33 panic Solution: read return 0 Verify: U212 Change-Id: Idcabf7eca7d99d020fb759261fd7f613da83b096 Signed-off-by: jintao xu --- diff --git a/drivers/amlogic/media/video_processor/v4lvideo/v4lvideo.c b/drivers/amlogic/media/video_processor/v4lvideo/v4lvideo.c index acb973c69f8c..a8256244555a 100644 --- a/drivers/amlogic/media/video_processor/v4lvideo/v4lvideo.c +++ b/drivers/amlogic/media/video_processor/v4lvideo/v4lvideo.c @@ -544,6 +544,13 @@ static int vidioc_close(struct file *file) return 0; } +static ssize_t vidioc_read(struct file *file, char __user *data, + size_t count, loff_t *ppos) +{ + pr_info("v4lvideo read\n"); + return 0; +} + static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *cap) @@ -791,7 +798,7 @@ static const struct v4l2_file_operations v4lvideo_v4l2_fops = { .owner = THIS_MODULE, .open = vidioc_open, .release = vidioc_close, - .read = vb2_fop_read, + .read = vidioc_read, .poll = vb2_fop_poll, .unlocked_ioctl = video_ioctl2,/* V4L2 ioctl handler */ .mmap = vb2_fop_mmap,