aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s2255drv.c
diff options
context:
space:
mode:
authorDean Anderson <dean@sensoray.com>2009-03-30 10:59:56 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:31 -0400
commitb7732a32af3335454fd274d1b09375416336b5b1 (patch)
tree3009aae00532fae989d46be31ebc789b02a7f1b8 /drivers/media/video/s2255drv.c
parent746ce939a2729fc6f15944f65d7b15574a243692 (diff)
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: Dean Anderson <dean@sensoray.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s2255drv.c')
-rw-r--r--drivers/media/video/s2255drv.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index b5be633e3bb0..5202cadb2aae 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -722,7 +722,6 @@ static void free_buffer(struct videobuf_queue *vq, struct s2255_buffer *buf)
722{ 722{
723 dprintk(4, "%s\n", __func__); 723 dprintk(4, "%s\n", __func__);
724 724
725 videobuf_waiton(&buf->vb, 0, 0);
726 videobuf_vmalloc_free(&buf->vb); 725 videobuf_vmalloc_free(&buf->vb);
727 buf->vb.state = VIDEOBUF_NEEDS_INIT; 726 buf->vb.state = VIDEOBUF_NEEDS_INIT;
728} 727}
@@ -1324,7 +1323,6 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
1324 1323
1325static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i) 1324static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
1326{ 1325{
1327 int res;
1328 struct s2255_fh *fh = priv; 1326 struct s2255_fh *fh = priv;
1329 struct s2255_dev *dev = fh->dev; 1327 struct s2255_dev *dev = fh->dev;
1330 1328
@@ -1338,9 +1336,7 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
1338 return -EINVAL; 1336 return -EINVAL;
1339 } 1337 }
1340 s2255_stop_acquire(dev, fh->channel); 1338 s2255_stop_acquire(dev, fh->channel);
1341 res = videobuf_streamoff(&fh->vb_vidq); 1339 videobuf_streamoff(&fh->vb_vidq);
1342 if (res < 0)
1343 return res;
1344 res_free(dev, fh); 1340 res_free(dev, fh);
1345 return 0; 1341 return 0;
1346} 1342}
@@ -1707,13 +1703,13 @@ static void s2255_destroy(struct kref *kref)
1707 kfree(dev->fw_data); 1703 kfree(dev->fw_data);
1708 usb_put_dev(dev->udev); 1704 usb_put_dev(dev->udev);
1709 dprintk(1, "%s", __func__); 1705 dprintk(1, "%s", __func__);
1710 kfree(dev);
1711 1706
1712 while (!list_empty(&s2255_devlist)) { 1707 while (!list_empty(&s2255_devlist)) {
1713 list = s2255_devlist.next; 1708 list = s2255_devlist.next;
1714 list_del(list); 1709 list_del(list);
1715 } 1710 }
1716 mutex_unlock(&dev->open_lock); 1711 mutex_unlock(&dev->open_lock);
1712 kfree(dev);
1717} 1713}
1718 1714
1719static int s2255_close(struct file *file) 1715static int s2255_close(struct file *file)