diff mbox

hdpvr: Fixes probing function.

Message ID 4C0664E2.4080003@trilogic.fr (mailing list archive)
State Accepted
Headers show

Commit Message

Perceval Anichini June 2, 2010, 2:04 p.m. UTC
None
diff mbox

Patch

From: Perceval Anichini <perceval@trilogic.fr>

In the hdpvr_probe () function, when an error occurs while probing the device,
the workqueue created by the create_single_thread () call is not properly
destroyed.

Signed-off-by: Perceval Anichini <perceval@trilogic.fr>
---

diff -r 304cfde05b3f linux/drivers/media/video/hdpvr/hdpvr-core.c
--- a/linux/drivers/media/video/hdpvr/hdpvr-core.c	Tue May 25 23:50:51 2010 -0400
+++ b/linux/drivers/media/video/hdpvr/hdpvr-core.c	Wed Jun 02 15:42:17 2010 +0200
@@ -286,6 +286,8 @@ 
 		goto error;
 	}
 
+	dev->workqueue = 0;
+
 	/* register v4l2_device early so it can be used for printks */
 	if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
 		err("v4l2_device_register failed");
@@ -380,6 +382,9 @@ 
 
 error:
 	if (dev) {
+		/* Destroy single thread */
+		if (dev->workqueue)
+			destroy_workqueue(dev->workqueue);
 		/* this frees allocated memory */
 		hdpvr_delete(dev);
 	}