Skip to contentSkip to conversation

patch: s2255drv driver removal problem fixed

PATCH Mauro Carvalho Chehab 1 participant 1 message Mar 30, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

C/C to the right mailing list, to allow Patchwork to catch this.

Forwarded message:

Date: Mon, 30 Mar 2009 07:59:56 -0700 (PDT)
From: "Dean A." <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: patch: s2255drv driver removal problem fixed

From: Dean Anderson <[email protected]>

This patch fixes kfree problem on driver removal, fixes streamoff problem and removes unnecessary videobuf_waiton from free_buffer function.

drivers/media/video/s2255drv.c renamed from drivers/media/video/s2255drv.c.orig +2 -6
@@ -723,7 +723,6 @@
 {
 	dprintk(4, "%s\n", __func__);
 
-	videobuf_waiton(&buf->vb, 0, 0);
 	videobuf_vmalloc_free(&buf->vb);
 	buf->vb.state = VIDEOBUF_NEEDS_INIT;
 }
@@ -1325,7 +1324,6 @@
 
 static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
 {
-	int res;
 	struct s2255_fh *fh = priv;
 	struct s2255_dev *dev = fh->dev;
 
@@ -1339,9 +1337,7 @@
 		return -EINVAL;
 	}
 	s2255_stop_acquire(dev, fh->channel);
-	res = videobuf_streamoff(&fh->vb_vidq);
-	if (res < 0)
-		return res;
+	videobuf_streamoff(&fh->vb_vidq);
 	res_free(dev, fh);
 	return 0;
 }
@@ -1708,13 +1704,13 @@
 	kfree(dev->fw_data);
 	usb_put_dev(dev->udev);
 	dprintk(1, "%s", __func__);
-	kfree(dev);
 
 	while (!list_empty(&s2255_devlist)) {
 		list = s2255_devlist.next;
 		list_del(list);
 	}
 	mutex_unlock(&dev->open_lock);
+	kfree(dev);
 }
 
 static int s2255_close(struct file *file)

Cheers,
Mauro