提交 b7732a32 编写于 作者: D Dean Anderson 提交者: Mauro Carvalho Chehab

V4L/DVB (11392): patch: s2255drv driver removal problem fixed

This patch fixes kfree problem on driver removal, fixes streamoff problem
and removes unnecessary videobuf_waiton from free_buffer function.
Signed-off-by: NDean Anderson <dean@sensoray.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 746ce939
...@@ -722,7 +722,6 @@ static void free_buffer(struct videobuf_queue *vq, struct s2255_buffer *buf) ...@@ -722,7 +722,6 @@ static void free_buffer(struct videobuf_queue *vq, struct s2255_buffer *buf)
{ {
dprintk(4, "%s\n", __func__); dprintk(4, "%s\n", __func__);
videobuf_waiton(&buf->vb, 0, 0);
videobuf_vmalloc_free(&buf->vb); videobuf_vmalloc_free(&buf->vb);
buf->vb.state = VIDEOBUF_NEEDS_INIT; buf->vb.state = VIDEOBUF_NEEDS_INIT;
} }
...@@ -1324,7 +1323,6 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) ...@@ -1324,7 +1323,6 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
{ {
int res;
struct s2255_fh *fh = priv; struct s2255_fh *fh = priv;
struct s2255_dev *dev = fh->dev; struct s2255_dev *dev = fh->dev;
...@@ -1338,9 +1336,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) ...@@ -1338,9 +1336,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
return -EINVAL; return -EINVAL;
} }
s2255_stop_acquire(dev, fh->channel); s2255_stop_acquire(dev, fh->channel);
res = videobuf_streamoff(&fh->vb_vidq); videobuf_streamoff(&fh->vb_vidq);
if (res < 0)
return res;
res_free(dev, fh); res_free(dev, fh);
return 0; return 0;
} }
...@@ -1707,13 +1703,13 @@ static void s2255_destroy(struct kref *kref) ...@@ -1707,13 +1703,13 @@ static void s2255_destroy(struct kref *kref)
kfree(dev->fw_data); kfree(dev->fw_data);
usb_put_dev(dev->udev); usb_put_dev(dev->udev);
dprintk(1, "%s", __func__); dprintk(1, "%s", __func__);
kfree(dev);
while (!list_empty(&s2255_devlist)) { while (!list_empty(&s2255_devlist)) {
list = s2255_devlist.next; list = s2255_devlist.next;
list_del(list); list_del(list);
} }
mutex_unlock(&dev->open_lock); mutex_unlock(&dev->open_lock);
kfree(dev);
} }
static int s2255_close(struct file *file) static int s2255_close(struct file *file)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册