Commit 07204aea authored by Perceval Anichini's avatar Perceval Anichini Committed by Mauro Carvalho Chehab

V4L/DVB: hdpvr: Fixes probing function

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: default avatarPerceval Anichini <perceval@trilogic.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fe85ce90
...@@ -286,6 +286,8 @@ static int hdpvr_probe(struct usb_interface *interface, ...@@ -286,6 +286,8 @@ static int hdpvr_probe(struct usb_interface *interface,
goto error; goto error;
} }
dev->workqueue = 0;
/* register v4l2_device early so it can be used for printks */ /* register v4l2_device early so it can be used for printks */
if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) { if (v4l2_device_register(&interface->dev, &dev->v4l2_dev)) {
err("v4l2_device_register failed"); err("v4l2_device_register failed");
...@@ -380,6 +382,9 @@ static int hdpvr_probe(struct usb_interface *interface, ...@@ -380,6 +382,9 @@ static int hdpvr_probe(struct usb_interface *interface,
error: error:
if (dev) { if (dev) {
/* Destroy single thread */
if (dev->workqueue)
destroy_workqueue(dev->workqueue);
/* this frees allocated memory */ /* this frees allocated memory */
hdpvr_delete(dev); hdpvr_delete(dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment